public final class JavaFileGeneratorUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getAddToListMethodInterface(JavaAttributeInfo attr,
String className)
Returns add to list method interface.
|
static String |
getCompareToForKeyClass(List<JavaAttributeInfo> attrs,
String className)
Returns compare to method for key class.
|
static String |
getDerivedPackage(org.onosproject.yang.compiler.datamodel.YangIdentity id)
Gets the derived package of YangIdentity.
|
static JavaQualifiedTypeInfoTranslator |
getDerivedPkfInfo(org.onosproject.yang.compiler.datamodel.YangIdentity id)
Returns package info of derived identity.
|
static File |
getFileObject(String filePath,
String fileName,
String extension,
JavaFileInfoTranslator handler)
Returns a file object for generated file.
|
static String |
getIdName(org.onosproject.yang.compiler.datamodel.YangIdentity id)
Returns Identity name of the Identity.
|
static org.onosproject.yang.compiler.datamodel.YangDataStructure |
getYangDataStructure(org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation annotation)
Returns YANG data structure from java attribute.
|
static void |
initiateJavaFileGeneration(File file,
int genType,
List<String> imports,
org.onosproject.yang.compiler.datamodel.YangNode curNode,
String name)
Initiates generation of file based on generated file type.
|
static void |
initiateJavaFileGeneration(File file,
String className,
int genType,
List<String> imports,
String pkg)
Initiates generation of file based on generated file type.
|
static org.onosproject.yang.compiler.datamodel.YangType |
isTypeLeafref(org.onosproject.yang.compiler.datamodel.YangType<?> attributeType)
Checks if the type is leafref and returns the effective type.
|
static String |
isTypeNameLeafref(String attributeName,
org.onosproject.yang.compiler.datamodel.YangType<?> attributeType)
Checks if the type name is leafref and returns the effective type name.
|
public static File getFileObject(String filePath, String fileName, String extension, JavaFileInfoTranslator handler)
filePath - file package pathfileName - file nameextension - file extensionhandler - cached file handlepublic static void initiateJavaFileGeneration(File file, String className, int genType, List<String> imports, String pkg) throws IOException
file - generated fileclassName - generated file class namegenType - generated file typeimports - imports for the filepkg - generated file packageIOException - when fails to generate a filepublic static void initiateJavaFileGeneration(File file, int genType, List<String> imports, org.onosproject.yang.compiler.datamodel.YangNode curNode, String name) throws IOException
file - generated filegenType - generated file typeimports - imports for the filecurNode - current YANG nodename - class nameIOException - when fails to generate a filepublic static String isTypeNameLeafref(String attributeName, org.onosproject.yang.compiler.datamodel.YangType<?> attributeType)
attributeName - name of the current typeattributeType - effective typepublic static org.onosproject.yang.compiler.datamodel.YangType isTypeLeafref(org.onosproject.yang.compiler.datamodel.YangType<?> attributeType)
attributeType - current typepublic static JavaQualifiedTypeInfoTranslator getDerivedPkfInfo(org.onosproject.yang.compiler.datamodel.YangIdentity id)
id - YANG identity.public static String getIdName(org.onosproject.yang.compiler.datamodel.YangIdentity id)
id - YANG identity.public static String getAddToListMethodInterface(JavaAttributeInfo attr, String className)
attr - java attributeclassName - name of the classpublic static org.onosproject.yang.compiler.datamodel.YangDataStructure getYangDataStructure(org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation annotation)
annotation - compiler annotationpublic static String getCompareToForKeyClass(List<JavaAttributeInfo> attrs, String className)
attrs - attribute listclassName - class namepublic static String getDerivedPackage(org.onosproject.yang.compiler.datamodel.YangIdentity id)
id - YANG Identity.Copyright © 2018. All rights reserved.