public abstract class BaseTemplate extends Object
Constructor and Description |
---|
BaseTemplate(org.opendaylight.mdsal.binding.java.api.generator.AbstractJavaGeneratedType javaType,
GeneratedType type) |
BaseTemplate(GeneratedType type) |
Modifier and Type | Method and Description |
---|---|
protected CharSequence |
asArguments(Iterable<GeneratedProperty> parameters)
Template method which generates sequence of the names of the class attributes from
parameters . |
protected CharSequence |
asArgumentsDeclaration(Iterable<GeneratedProperty> parameters)
Template method which generates method parameters with their types from
parameters . |
String |
asCode(String text) |
protected CharSequence |
asJavadoc(String comment)
Template method which generates JAVA comments.
|
String |
asLink(String text) |
protected abstract CharSequence |
body() |
protected CharSequence |
checkArgument(GeneratedProperty property,
Restrictions restrictions,
Type actualType,
String value) |
protected CharSequence |
emitConstant(Constant c) |
static String |
encodeJavadocSymbols(String description) |
protected CharSequence |
fieldName(GeneratedProperty property) |
protected String |
formatDataForJavaDoc(GeneratedType type) |
protected String |
formatDataForJavaDoc(GeneratedType type,
String additionalComment) |
protected static String |
formatDataForJavaDoc(TypeMember type,
String additionalComment) |
protected static String |
formatToParagraph(String text) |
String |
generate() |
protected CharSequence |
generateCheckers(GeneratedProperty field,
Restrictions restrictions,
Type actualType) |
protected CharSequence |
generateParameters(List<MethodSignature.Parameter> parameters)
Template method which generates method parameters with their types from
parameters . |
protected CharSequence |
generateToString(Collection<GeneratedProperty> properties) |
protected CharSequence |
getterMethod(GeneratedProperty field)
Template method which generates the getter method for
field |
protected String |
getterMethodName(GeneratedProperty field) |
protected CharSequence |
hashCodeResult(Collection<GeneratedProperty> properties) |
protected String |
propertyNameFromGetter(MethodSignature getter) |
protected CharSequence |
setterMethod(GeneratedProperty field)
Template method which generates the setter method for
field |
static String |
wrapToDocumentation(String text) |
public BaseTemplate(GeneratedType type)
public BaseTemplate(org.opendaylight.mdsal.binding.java.api.generator.AbstractJavaGeneratedType javaType, GeneratedType type)
public final String generate()
protected abstract CharSequence body()
protected final CharSequence fieldName(GeneratedProperty property)
protected final String propertyNameFromGetter(MethodSignature getter)
protected CharSequence getterMethod(GeneratedProperty field)
field
field
- generated property with data about field which is generated as the getter methodprotected final String getterMethodName(GeneratedProperty field)
protected final CharSequence setterMethod(GeneratedProperty field)
field
field
- generated property with data about field which is generated as the setter methodprotected final CharSequence asArgumentsDeclaration(Iterable<GeneratedProperty> parameters)
parameters
.parameters
- group of generated property instances which are transformed to the method parametersprotected final CharSequence asArguments(Iterable<GeneratedProperty> parameters)
parameters
.parameters
- group of generated property instances which are transformed to the sequence of parameter namesparameters
protected CharSequence asJavadoc(String comment)
comment
- string with the comment for whole JAVA classprotected String formatDataForJavaDoc(GeneratedType type)
protected String formatDataForJavaDoc(GeneratedType type, String additionalComment)
protected static String formatDataForJavaDoc(TypeMember type, String additionalComment)
protected CharSequence generateToString(Collection<GeneratedProperty> properties)
protected CharSequence generateParameters(List<MethodSignature.Parameter> parameters)
parameters
.parameters
- list of parameter instances which are transformed to the method parametersprotected CharSequence emitConstant(Constant c)
protected CharSequence generateCheckers(GeneratedProperty field, Restrictions restrictions, Type actualType)
protected CharSequence checkArgument(GeneratedProperty property, Restrictions restrictions, Type actualType, String value)
protected CharSequence hashCodeResult(Collection<GeneratedProperty> properties)
Copyright © 2019 OpenDaylight. All rights reserved.