|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jexl3.internal.TemplateScript
public final class TemplateScript
A Template instance.
Constructor Summary | |
---|---|
TemplateScript(TemplateEngine engine,
JexlInfo info,
String directive,
Reader reader,
String... parms)
Creates a new template from an character input. |
Method Summary | |
---|---|
String |
asString()
Recreate the template source from its inner components. |
void |
evaluate(JexlContext context,
Writer writer)
Evaluates this template. |
void |
evaluate(JexlContext context,
Writer writer,
Object... args)
Evaluates this template. |
String[] |
getParameters()
Gets the list of parameters expected by this template. |
Map<String,Object> |
getPragmas()
Gets this script pragmas. |
Set<List<String>> |
getVariables()
Gets the list of variables accessed by this template. |
TemplateScript |
prepare(JexlContext context)
Prepares this template by expanding any contained deferred TemplateExpression. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TemplateScript(TemplateEngine engine, JexlInfo info, String directive, Reader reader, String... parms)
engine
- the template engineinfo
- the source infodirective
- the prefix for lines of code; can not be "$", "${", "#" or "#{"
since this would preclude being able to differentiate directives and jxlt expressionsreader
- the input readerparms
- the parameter names
NullPointerException
- if either the directive prefix or input is null
IllegalArgumentException
- if the directive prefix is invalidMethod Detail |
---|
public String toString()
toString
in class Object
public String asString()
JxltEngine.Template
asString
in interface JxltEngine.Template
public TemplateScript prepare(JexlContext context)
JxltEngine.Template
prepare
in interface JxltEngine.Template
context
- the context to prepare against
public void evaluate(JexlContext context, Writer writer)
JxltEngine.Template
evaluate
in interface JxltEngine.Template
context
- the context to use during evaluationwriter
- the writer to use for outputpublic void evaluate(JexlContext context, Writer writer, Object... args)
JxltEngine.Template
evaluate
in interface JxltEngine.Template
context
- the context to use during evaluationwriter
- the writer to use for outputargs
- the argumentspublic Set<List<String>> getVariables()
JxltEngine.Template
This method will visit all nodes of the sub-expressions and extract all variables whether they are written in 'dot' or 'bracketed' notation. (a.b is equivalent to a['b']).
getVariables
in interface JxltEngine.Template
public String[] getParameters()
JxltEngine.Template
getParameters
in interface JxltEngine.Template
public Map<String,Object> getPragmas()
JxltEngine.Template
getPragmas
in interface JxltEngine.Template
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |