public class ClassTemplate extends BaseTemplate
Modifier and Type | Field and Description |
---|---|
protected Iterable<GeneratedProperty> |
allProperties |
protected List<Constant> |
consts
List of constant instances which are generated as JAVA public static final attributes.
|
protected List<Enumeration> |
enums
List of enumeration which are generated as JAVA enum type.
|
protected List<GeneratedProperty> |
finalProperties |
protected GeneratedTransferObject |
genTO |
protected List<GeneratedProperty> |
parentProperties |
protected List<GeneratedProperty> |
properties |
protected Restrictions |
restrictions |
Constructor and Description |
---|
ClassTemplate(org.opendaylight.mdsal.binding.java.api.generator.AbstractJavaGeneratedType javaType,
GeneratedTransferObject genType)
Creates instance of this class with concrete
genType . |
ClassTemplate(GeneratedTransferObject genType)
Creates instance of this class with concrete
genType . |
Modifier and Type | Method and Description |
---|---|
protected CharSequence |
allValuesConstructor() |
protected CharSequence |
annotationDeclaration() |
protected CharSequence |
bitsArgs() |
protected CharSequence |
body() |
protected CharSequence |
constantsDeclarations()
Template method which generates JAVA constants.
|
protected CharSequence |
constructors() |
protected CharSequence |
copyConstructor() |
protected CharSequence |
defaultInstance() |
protected CharSequence |
enumDeclarations()
Template method which generates JAVA enum type.
|
protected CharSequence |
genConstructor(GeneratedProperty property,
GeneratedProperty... other) |
CharSequence |
generateAsInnerClass()
Generates JAVA class source code (class body only).
|
protected CharSequence |
generateBody(boolean isInnerClass)
Template method which generates class body.
|
protected CharSequence |
generateClassDeclaration(boolean isInnerClass)
Template method which generates JAVA class declaration.
|
protected CharSequence |
generateEquals()
Template method which generates the method
equals() . |
protected CharSequence |
generateFields()
Template method which generates JAVA class attributes.
|
protected CharSequence |
generateGetValueForBitsTypeDef()
Template method which generates the method
getValue() for typedef,
which base type is BitsDefinition. |
protected String |
generateHashCode()
Template method which generates the method
hashCode() . |
protected CharSequence |
genUnionConstructor() |
GeneratedProperty |
getPropByName(String name) |
protected CharSequence |
innerClassesDeclarations()
Template method which generates inner classes inside this interface.
|
protected boolean |
isReadOnly(GeneratedProperty field) |
protected CharSequence |
parentConstructor() |
protected CharSequence |
propsAsArgs(Iterable<GeneratedProperty> properties) |
protected CharSequence |
suidDeclaration() |
asArguments, asArgumentsDeclaration, asCode, asJavadoc, asLink, checkArgument, emitConstant, encodeJavadocSymbols, fieldName, formatDataForJavaDoc, formatDataForJavaDoc, formatDataForJavaDoc, formatToParagraph, generate, generateCheckers, generateParameters, generateToString, getterMethod, getterMethodName, hashCodeResult, propertyNameFromGetter, setterMethod, wrapToDocumentation
protected final List<GeneratedProperty> properties
protected final List<GeneratedProperty> finalProperties
protected final List<GeneratedProperty> parentProperties
protected final Iterable<GeneratedProperty> allProperties
protected final Restrictions restrictions
protected final List<Enumeration> enums
protected final List<Constant> consts
protected final GeneratedTransferObject genTO
public ClassTemplate(GeneratedTransferObject genType)
genType
.genType
- generated transfer object which will be transformed to JAVA class source codepublic ClassTemplate(org.opendaylight.mdsal.binding.java.api.generator.AbstractJavaGeneratedType javaType, GeneratedTransferObject genType)
genType
.genType
- generated transfer object which will be transformed to JAVA class source codepublic CharSequence generateAsInnerClass()
protected CharSequence body()
body
in class BaseTemplate
protected CharSequence generateBody(boolean isInnerClass)
isInnerClass
- boolean value which specify if generated class is|isn't innerprotected CharSequence generateGetValueForBitsTypeDef()
getValue()
for typedef,
which base type is BitsDefinition.getValue()
method definition in JAVA formatprotected CharSequence innerClassesDeclarations()
protected CharSequence constructors()
protected CharSequence allValuesConstructor()
protected CharSequence genUnionConstructor()
protected CharSequence genConstructor(GeneratedProperty property, GeneratedProperty... other)
protected CharSequence copyConstructor()
protected CharSequence parentConstructor()
protected CharSequence defaultInstance()
protected CharSequence bitsArgs()
protected CharSequence propsAsArgs(Iterable<GeneratedProperty> properties)
protected CharSequence generateClassDeclaration(boolean isInnerClass)
isInnerClass
- boolean value which specify if generated class is|isn't innerprotected CharSequence enumDeclarations()
protected CharSequence suidDeclaration()
protected CharSequence annotationDeclaration()
protected CharSequence constantsDeclarations()
protected CharSequence generateFields()
protected boolean isReadOnly(GeneratedProperty field)
protected String generateHashCode()
hashCode()
.hashCode()
method definition in JAVA formatprotected CharSequence generateEquals()
equals()
.equals()
method definition in JAVA formatpublic GeneratedProperty getPropByName(String name)
Copyright © 2019 OpenDaylight. All rights reserved.