public abstract class BaseRenderer extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
BaseRenderer(GeneratedType type) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
asArgumentsDeclaration(Collection<GeneratedProperty> parameters)
Template method which generates method parameters with their types from
parameters. |
protected abstract String |
body()
Implementation needs to call Scala template render() method to generate string body
|
protected GeneratedProperty |
findProperty(GeneratedTransferObject gto,
String name) |
protected String |
generateParameters(List<MethodSignature.Parameter> parameters)
Template method which generates method parameters with their types from
parameters. |
String |
generateTemplate()
builds template
|
protected String |
getFromImportMap(@NonNull String typeName) |
protected Map<String,String> |
getImportedNames() |
protected Map<String,String> |
getImportMap() |
protected String |
getterMethod(GeneratedProperty field)
Template method which generates the getter method for field
|
protected GeneratedType |
getType() |
protected boolean |
hasSamePackage(String importedTypePackageName)
Checks if package of generated type and imported type is the same
|
protected String |
importedName(Class<?> cls) |
protected String |
importedName(Type intype) |
protected String |
packageDefinition() |
protected void |
putAllToImportMap(@NonNull Map<String,String> imports) |
protected void |
putToImportMap(@NonNull String typeName,
String typePackageName) |
protected BaseRenderer(GeneratedType type)
protected abstract String body()
protected GeneratedType getType()
protected String importedName(Type intype)
intype - type to format and add to importsprotected String packageDefinition()
protected String asArgumentsDeclaration(Collection<GeneratedProperty> parameters)
parameters.parameters - group of generated property instances which are transformed to the method parametersprotected boolean hasSamePackage(String importedTypePackageName)
importedTypePackageName - imported types package nameprotected GeneratedProperty findProperty(GeneratedTransferObject gto, String name)
protected String generateParameters(List<MethodSignature.Parameter> parameters)
parameters.
InterfaceTemplate / UnionTemaplateparameters - list of parameter instances which are transformed to the method parametersprotected String getterMethod(GeneratedProperty field)
field - generated property with data about field which is generated as the getter methodpublic String generateTemplate()
Copyright © 2018 OpenDaylight. All rights reserved.