public abstract class BaseTemplate extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
importMap |
protected GeneratedType |
type |
Constructor and Description |
---|
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 |
emitConstant(Constant c) |
static String |
encodeJavadocSymbols(String description) |
protected CharSequence |
fieldName(GeneratedProperty property) |
protected GeneratedProperty |
findProperty(GeneratedTransferObject gto,
String name) |
protected String |
formatDataForJavaDoc(GeneratedType type) |
protected String |
formatDataForJavaDoc(GeneratedType type,
String additionalComment) |
protected String |
formatDataForJavaDoc(TypeMember type,
String additionalComment) |
protected String |
formatToParagraph(String text) |
String |
generate() |
protected CharSequence |
generateParameters(List<MethodSignature.Parameter> parameters)
Template method which generates method parameters with their types from
parameters . |
protected CharSequence |
generateToString(Collection<GeneratedProperty> properties) |
Restrictions |
getRestrictions(Type type) |
protected CharSequence |
getterMethod(GeneratedProperty field)
Template method which generates the getter method for
field |
protected String |
getterMethodName(GeneratedProperty field) |
protected String |
importedName(Class<?> cls) |
protected String |
importedName(Type intype) |
protected CharSequence |
imports() |
protected boolean |
isAccessor(MethodSignature maybeGetter) |
boolean |
isLocalInnerClass(String importedTypePackageName) |
CharSequence |
packageDefinition() |
protected String |
propertyNameFromGetter(MethodSignature getter) |
protected CharSequence |
setterMethod(GeneratedProperty field)
Template method which generates the setter method for
field |
String |
wrapToDocumentation(String text) |
protected final GeneratedType type
public BaseTemplate(GeneratedType _type)
public CharSequence packageDefinition()
public final String generate()
protected CharSequence imports()
public boolean isLocalInnerClass(String importedTypePackageName)
protected abstract CharSequence body()
protected final CharSequence fieldName(GeneratedProperty property)
protected final String propertyNameFromGetter(MethodSignature getter)
protected final boolean isAccessor(MethodSignature maybeGetter)
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 String formatDataForJavaDoc(TypeMember type, String additionalComment)
protected CharSequence generateToString(Collection<GeneratedProperty> properties)
public Restrictions getRestrictions(Type type)
protected CharSequence generateParameters(List<MethodSignature.Parameter> parameters)
parameters
.parameters
- list of parameter instances which are transformed to the method parametersprotected GeneratedProperty findProperty(GeneratedTransferObject gto, String name)
protected CharSequence emitConstant(Constant c)
Copyright © 2019 OpenDaylight. All rights reserved.