abstract class TemplateVars
extends java.lang.Object
parsedTemplate()
method which is the template to substitute them into. Once the values
of the fields have been assigned, the toText()
method returns the result of substituting
them into the template.
The subclass must be a direct subclass of this class. Fields cannot be static unless they are also final. They cannot be private, though they can be package-private if the class is in the same package as this class. They cannot be primitive or null, so that there is a clear indication when a field has not been set.
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<java.lang.reflect.Field> |
fields |
private static org.apache.velocity.runtime.RuntimeInstance |
velocityRuntimeInstance |
Constructor and Description |
---|
TemplateVars() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.Object |
fieldValue(java.lang.reflect.Field field,
java.lang.Object container) |
private static boolean |
isStaticFinal(java.lang.reflect.Field field) |
(package private) abstract org.apache.velocity.runtime.parser.node.SimpleNode |
parsedTemplate() |
(package private) static org.apache.velocity.runtime.parser.node.SimpleNode |
parsedTemplateForResource(java.lang.String resourceName) |
(package private) java.lang.String |
toText()
Returns the result of substituting the variables defined by the fields of this class
(a concrete subclass of TemplateVars) into the template returned by
parsedTemplate() . |
private org.apache.velocity.VelocityContext |
toVelocityContext() |
private static final org.apache.velocity.runtime.RuntimeInstance velocityRuntimeInstance
private final com.google.common.collect.ImmutableList<java.lang.reflect.Field> fields
abstract org.apache.velocity.runtime.parser.node.SimpleNode parsedTemplate()
java.lang.String toText()
parsedTemplate()
.private org.apache.velocity.VelocityContext toVelocityContext()
static org.apache.velocity.runtime.parser.node.SimpleNode parsedTemplateForResource(java.lang.String resourceName)
private static java.lang.Object fieldValue(java.lang.reflect.Field field, java.lang.Object container)
private static boolean isStaticFinal(java.lang.reflect.Field field)