public final class YangJavaModelUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
generateCodeAndUpdateInParent(JavaCodeGeneratorInfo info,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config,
boolean isMultiInstance)
Generates code for the current ata model node and adds itself as an
attribute in the parent.
|
static void |
generateCodeOfAugmentableNode(JavaCodeGeneratorInfo info,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
Generates code for the current data model node and adds support for it to
be augmented.
|
static void |
generateCodeOfNode(JavaCodeGeneratorInfo info,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
Generates code for the current data model node.
|
static void |
generateCodeOfRootNode(JavaCodeGeneratorInfo info,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config,
String rootPkg)
Generates code for the root module/sub-module node.
|
static void |
generateInterfaceFileForNonDataNodes(org.onosproject.yang.compiler.datamodel.YangNode rootNode)
Generates interface file for those yang file which contains only any
of these grouping, typedef and identity.
|
static void |
generateJava(int type,
org.onosproject.yang.compiler.datamodel.YangNode node)
Generated java code during exit.
|
static String |
getAugmentClassName(org.onosproject.yang.compiler.datamodel.YangAugment augment,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
Returns augment class name.
|
static String |
getCurNodePackage(org.onosproject.yang.compiler.datamodel.YangNode curNode)
Returns the node package string.
|
static String |
getNodesPackage(org.onosproject.yang.compiler.datamodel.YangNode node,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
Returns nodes package.
|
static boolean |
isRootNodesCodeGenRequired(org.onosproject.yang.compiler.datamodel.YangNode node)
Returns true if root node contains any data node.
|
static void |
updatePackageInfo(JavaCodeGeneratorInfo info,
org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
Updates YANG java file package information.
|
public static void updatePackageInfo(JavaCodeGeneratorInfo info, org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
info - YANG java file info nodeconfig - YANG plugin configpublic static void generateCodeAndUpdateInParent(JavaCodeGeneratorInfo info, org.onosproject.yang.compiler.utils.io.YangPluginConfig config, boolean isMultiInstance) throws IOException
info - YANG java file info nodeconfig - YANG plugin configisMultiInstance - flag to indicate whether it's a listIOException - IO operations failspublic static void generateCodeOfAugmentableNode(JavaCodeGeneratorInfo info, org.onosproject.yang.compiler.utils.io.YangPluginConfig config) throws IOException
info - YANG java file info nodeconfig - YANG plugin configIOException - IO operations failspublic static void generateCodeOfNode(JavaCodeGeneratorInfo info, org.onosproject.yang.compiler.utils.io.YangPluginConfig config) throws IOException
info - YANG java file info nodeconfig - YANG plugin configIOException - IO operations failspublic static void generateCodeOfRootNode(JavaCodeGeneratorInfo info, org.onosproject.yang.compiler.utils.io.YangPluginConfig config, String rootPkg) throws IOException
info - YANG java file info nodeconfig - YANG plugin configrootPkg - package of the root nodeIOException - IO operations failspublic static String getCurNodePackage(org.onosproject.yang.compiler.datamodel.YangNode curNode) throws TranslatorException
curNode - current java node whose package string needs to be setTranslatorException - on errorpublic static boolean isRootNodesCodeGenRequired(org.onosproject.yang.compiler.datamodel.YangNode node)
node - root YANG nodepublic static String getNodesPackage(org.onosproject.yang.compiler.datamodel.YangNode node, org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
node - YANG nodeconfig - plugin configpublic static String getAugmentClassName(org.onosproject.yang.compiler.datamodel.YangAugment augment, org.onosproject.yang.compiler.utils.io.YangPluginConfig config)
augment - YANG augmentconfig - plugin configurationspublic static void generateJava(int type,
org.onosproject.yang.compiler.datamodel.YangNode node)
throws IOException
type - generated file typenode - current YANG nodeIOException - when fails to generate java filespublic static void generateInterfaceFileForNonDataNodes(org.onosproject.yang.compiler.datamodel.YangNode rootNode)
throws IOException
rootNode - root nodeIOException - when fails to do IO operationsCopyright © 2018. All rights reserved.