public final class JavaCodeSnippetGen extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addListenersImport(org.onosproject.yang.compiler.datamodel.YangNode curNode,
List<String> imports,
org.onosproject.yang.compiler.utils.UtilConstants.Operation operation)
Adds listener's imports.
|
static String |
generateEnumAttributeString(String name,
int value)
Returns string for enum's attribute.
|
static String |
generateEnumAttributeStringWithSchemaName(String name,
int value)
Returns string for enum's attribute for enum class.
|
static String |
getFileHeaderComment()
Returns the java file header comment.
|
static String |
getJavaAttributeDefinition(String typePkg,
String attrType,
String attrName,
boolean isList,
String accessType,
org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation annotation)
Returns the textual java code for attribute definition in class.
|
static List<String> |
sortImports(List<String> imports)
Returns sorted import list.
|
public static String getFileHeaderComment()
public static String getJavaAttributeDefinition(String typePkg, String attrType, String attrName, boolean isList, String accessType, org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation annotation)
typePkg - Package of the attribute typeattrType - java attribute typeattrName - name of the attributeisList - is list attributeaccessType - attribute access typeannotation - compiler annotationpublic static String generateEnumAttributeString(String name, int value)
name - name of attributevalue - value of the enumpublic static String generateEnumAttributeStringWithSchemaName(String name, int value)
name - name of attributevalue - value of the enumpublic static List<String> sortImports(List<String> imports)
imports - import listpublic static void addListenersImport(org.onosproject.yang.compiler.datamodel.YangNode curNode,
List<String> imports,
org.onosproject.yang.compiler.utils.UtilConstants.Operation operation)
curNode - currentYangNode.imports - import listoperation - add or removeCopyright © 2018. All rights reserved.