public class Template
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
evaluate(java.util.Map<java.lang.String,?> vars)
Evaluate the given template with the given initial set of variables.
|
static Template |
parseFrom(java.io.Reader reader)
Parse a VTL template from the given
Reader . |
private final Node root
Template(Node root)
public static Template parseFrom(java.io.Reader reader) throws java.io.IOException
Reader
.java.io.IOException
public java.lang.String evaluate(java.util.Map<java.lang.String,?> vars)
vars
- a map where the keys are variable names and the values are the corresponding
variable values. For example, if "x"
maps to 23, then $x
in the template
will expand to 23.