Class EnumTemplate
java.lang.Object
org.opendaylight.yangtools.binding.codegen.BaseTemplate
org.opendaylight.yangtools.binding.codegen.EnumTemplate
Template for generating JAVA enumeration type.
-
Constructor Summary
ConstructorsConstructorDescriptionEnumTemplate
(org.opendaylight.yangtools.binding.codegen.AbstractJavaGeneratedType javaType, Enumeration enums) Constructs instance of this class with concreteenums
.EnumTemplate
(Enumeration enums) Constructs instance of this class with concreteenums
. -
Method Summary
Modifier and TypeMethodDescriptionbody()
Template method which generates enumeration body (declaration + enumeration items).Generates only JAVA enumeration source code.protected static Optional
<MethodSignature> getterByName
(Iterable<MethodSignature> methods, String implMethodName) protected static String
propertyNameFromGetter
(String getterName) protected static String
writeEnumeration
(Enumeration enumeration) writeEnumItem
(String name, String mappedName, int value, String description) Methods inherited from class org.opendaylight.yangtools.binding.codegen.BaseTemplate
asArguments, asArgumentsDeclaration, asJavadoc, asLink, asNonNullArgumentsDeclaration, checkArgument, emitConstant, formatDataForJavaDoc, formatDataForJavaDoc, formatReference, formatToParagraph, generateAnnotation, generateCheckers, generateParameters, getterMethod, setterMethod, wrapToDocumentation
-
Constructor Details
-
EnumTemplate
public EnumTemplate(org.opendaylight.yangtools.binding.codegen.AbstractJavaGeneratedType javaType, Enumeration enums) Constructs instance of this class with concreteenums
.- Parameters:
enums
- enumeration which will be transformed to JAVA source code
-
EnumTemplate
Constructs instance of this class with concreteenums
.- Parameters:
enums
- enumeration which will be transformed to JAVA source code
-
-
Method Details
-
generateAsInnerClass
Generates only JAVA enumeration source code.- Returns:
- string with JAVA enumeration source code
-
writeEnumItem
-
body
Template method which generates enumeration body (declaration + enumeration items).- Returns:
- string with the enumeration body
-
writeEnumeration
-
getterByName
protected static Optional<MethodSignature> getterByName(Iterable<MethodSignature> methods, String implMethodName) -
propertyNameFromGetter
-
propertyNameFromGetter
-