|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jexl3.JxltEngine
org.apache.commons.jexl3.internal.TemplateEngine
public final class TemplateEngine
A JxltEngine implementation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.commons.jexl3.JxltEngine |
---|
JxltEngine.Exception, JxltEngine.Expression, JxltEngine.Template |
Constructor Summary | |
---|---|
TemplateEngine(Engine aJexl,
boolean noScript,
int cacheSize,
char immediate,
char deferred)
Creates a new instance of JxltEngine creating a local cache. |
Method Summary | |
---|---|
void |
clearCache()
Clears the cache. |
JxltEngine.Expression |
createExpression(JexlInfo info,
String expression)
Creates a a JxltEngine.Expression from an expression string. |
TemplateScript |
createTemplate(JexlInfo info,
String prefix,
Reader source,
String... parms)
Creates a new template. |
Engine |
getEngine()
Gets the JexlEngine underlying this JxltEngine. |
protected static Iterator<CharSequence> |
readLines(Reader reader)
Read lines from a (buffered / mark-able) reader keeping all new-lines and line-feeds. |
protected List<org.apache.commons.jexl3.internal.TemplateEngine.Block> |
readTemplate(String prefix,
Reader source)
Reads lines of a template grouping them by typed blocks. |
protected int |
startsWith(CharSequence sequence,
CharSequence pattern)
Whether a sequence starts with a given set of characters (following spaces). |
Methods inherited from class org.apache.commons.jexl3.JxltEngine |
---|
createExpression, createTemplate, createTemplate, createTemplate, createTemplate, createTemplate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemplateEngine(Engine aJexl, boolean noScript, int cacheSize, char immediate, char deferred)
JxltEngine
creating a local cache.
aJexl
- the JexlEngine to use.noScript
- whether this engine only allows JEXL expressions or scriptscacheSize
- the number of expressions in this cache, default is 256immediate
- the immediate template expression character, default is '$'deferred
- the deferred template expression character, default is '#'Method Detail |
---|
public Engine getEngine()
getEngine
in class JxltEngine
public void clearCache()
clearCache
in class JxltEngine
public JxltEngine.Expression createExpression(JexlInfo info, String expression)
JxltEngine
JxltEngine.Expression
from an expression string.
Uses and fills up the expression cache if any.
If the underlying JEXL engine is silent, errors will be logged through its logger as warnings.
createExpression
in class JxltEngine
info
- the JexlInfo
source informationexpression
- the JxltEngine.Template
string expression
JxltEngine.Expression
, null if silent and an error occuredprotected int startsWith(CharSequence sequence, CharSequence pattern)
Space characters at beginning of line before the pattern are discarded.
sequence
- the sequencepattern
- the pattern to match at start of sequence
protected static Iterator<CharSequence> readLines(Reader reader)
reader
- the reader
protected List<org.apache.commons.jexl3.internal.TemplateEngine.Block> readTemplate(String prefix, Reader source)
prefix
- the directive prefixsource
- the source reader
public TemplateScript createTemplate(JexlInfo info, String prefix, Reader source, String... parms)
JxltEngine
createTemplate
in class JxltEngine
info
- the jexl info (file, line, column)prefix
- the directive prefixsource
- the sourceparms
- the parameter names
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |