public final class MethodsGenerator extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getAddAugmentationString()
Returns add augmentation method string.
|
static String |
getAddToListMethodImpl(JavaAttributeInfo attr,
String name)
Returns add to list method impl.
|
static String |
getAugmentationsString()
Returns augmentations method string.
|
static String |
getAugmentationString()
Returns augmentation method string.
|
static String |
getConstructor(JavaAttributeInfo attr,
int genType)
Returns the constructor strings for class file.
|
static String |
getDefaultConstructorString(String name,
String modifierType)
Returns default constructor method string.
|
static String |
getEqualsMethod(JavaAttributeInfo attr)
Returns equals method for class.
|
static String |
getFromStringMethod(JavaAttributeInfo attr,
JavaAttributeInfo fromAttr)
Return from string method's body string.
|
static String |
getFromStringMethodForIdentity(String name,
String schemaName,
List<org.onosproject.yang.compiler.datamodel.YangIdentity> idList)
Returns from string method for identity class.
|
static String |
getGetterForClass(JavaAttributeInfo attr,
int generatedJavaFiles)
Returns the getter method strings for class file.
|
static String |
getGetterString(JavaAttributeInfo attr,
int genType)
Returns getter string.
|
static String |
getHashCodeMethod(JavaAttributeInfo attr)
Returns hash code method for class.
|
static String |
getOfMethodStringAndJavaDoc(JavaAttributeInfo attr,
String className)
Returns of method's string and java doc for special type.
|
static String |
getParaMeterisiedConstructor(String name,
String modifierType,
Map<String,String> params,
String space)
Returns parameterisied constructor string.
|
static String |
getRemoveAugmentationString()
Returns remove augmentation method string.
|
static String |
getRpcServiceMethod(String rpcName,
String input,
String output)
Returns the rpc strings for service interface.
|
static String |
getSetterForClass(JavaAttributeInfo attr,
int generatedJavaFiles)
Returns the setter method strings for class file.
|
static String |
getSetterString(JavaAttributeInfo attr,
String className,
int genType)
Returns setter string.
|
static String |
getToStringMethod(JavaAttributeInfo attr)
Returns to string method for class.
|
static String |
getToStringMethodForIdentity(String name)
To string method for identity.
|
static String |
getTypeConstructorStringAndJavaDoc(JavaAttributeInfo attr1,
JavaAttributeInfo attr2,
String genType,
ValidatorTypeForUnionTypes type,
boolean addFirst,
int count)
Returns string and java doc for constructor of type class.
|
static String |
getTypeConstructorStringAndJavaDoc(JavaAttributeInfo attr,
String className,
int genType,
int count)
Returns string and java doc for constructor of type class.
|
public static String getGetterString(JavaAttributeInfo attr, int genType)
attr - attribute infogenType - generated java filespublic static String getSetterString(JavaAttributeInfo attr, String className, int genType)
attr - attribute infoclassName - java class namegenType - generated java filespublic static String getDefaultConstructorString(String name, String modifierType)
name - class namemodifierType - modifier typepublic static String getAddAugmentationString()
public static String getRemoveAugmentationString()
public static String getAugmentationsString()
public static String getAugmentationString()
public static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles)
attr - attribute infogeneratedJavaFiles - for the type of java file being generatedpublic static String getSetterForClass(JavaAttributeInfo attr, int generatedJavaFiles)
attr - attribute infogeneratedJavaFiles - generated java filespublic static String getConstructor(JavaAttributeInfo attr, int genType)
attr - attribute infogenType - generated java filespublic static String getRpcServiceMethod(String rpcName, String input, String output)
rpcName - name of the rpcinput - name of inputoutput - name of outputpublic static String getToStringMethod(JavaAttributeInfo attr)
attr - java attributepublic static String getFromStringMethod(JavaAttributeInfo attr, JavaAttributeInfo fromAttr)
attr - attribute infofromAttr - attribute info for the from string wrapper
typepublic static String getHashCodeMethod(JavaAttributeInfo attr)
attr - attribute infopublic static String getEqualsMethod(JavaAttributeInfo attr)
attr - attribute infopublic static String getOfMethodStringAndJavaDoc(JavaAttributeInfo attr, String className)
attr - attribute infoclassName - class namepublic static String getTypeConstructorStringAndJavaDoc(JavaAttributeInfo attr, String className, int genType, int count)
attr - attribute infoclassName - class namegenType - generate file typecount - type countpublic static String getTypeConstructorStringAndJavaDoc(JavaAttributeInfo attr1, JavaAttributeInfo attr2, String genType, ValidatorTypeForUnionTypes type, boolean addFirst, int count)
attr1 - first attribute infoattr2 - second attribute infogenType - class nametype - conflict validate typeaddFirst - whether int came first or uInt came firstcount - type countpublic static String getAddToListMethodImpl(JavaAttributeInfo attr, String name)
attr - java attributename - class namepublic static String getToStringMethodForIdentity(String name)
name - name of identitypublic static String getFromStringMethodForIdentity(String name, String schemaName, List<org.onosproject.yang.compiler.datamodel.YangIdentity> idList)
name - name of identityschemaName - schema nameidList - list of derived identitiespublic static String getParaMeterisiedConstructor(String name, String modifierType, Map<String,String> params, String space)
name - class namemodifierType - modifier typeparams - parameters for constructorspace - indentation for constructorCopyright © 2018. All rights reserved.