public class JinjavaInterpreter extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BLOCK_STUB_END |
static String |
BLOCK_STUB_START |
static String |
INSERT_FLAG |
Constructor and Description |
---|
JinjavaInterpreter(Jinjava application,
Context context,
JinjavaConfig renderConfig) |
JinjavaInterpreter(JinjavaInterpreter orig) |
Modifier and Type | Method and Description |
---|---|
void |
addBlock(String name,
LinkedList<? extends Node> value) |
void |
addError(TemplateError templateError) |
void |
addExtendParentRoot(Node root) |
void |
enterScope() |
JinjavaConfig |
getConfig() |
JinjavaConfig |
getConfiguration() |
Context |
getContext() |
static JinjavaInterpreter |
getCurrent() |
List<TemplateError> |
getErrors() |
int |
getLineNumber() |
String |
getResource(String resource) |
void |
leaveScope() |
Node |
parse(String template) |
static void |
popCurrent() |
static void |
pushCurrent(JinjavaInterpreter interpreter) |
String |
render(Node root) |
String |
render(Node root,
boolean processExtendRoots) |
String |
render(String template) |
String |
renderString(String template) |
Object |
resolveELExpression(String expression,
int lineNumber)
Resolve expression against current context.
|
Object |
resolveObject(String variable,
int lineNumber)
Resolve a variable into an object value.
|
Object |
resolveProperty(Object object,
List<String> propertyNames)
Resolve property of bean.
|
Object |
resolveProperty(Object object,
String propertyName)
Resolve property of bean.
|
String |
resolveString(String variable,
int lineNumber)
Resolve a variable into a string value.
|
Object |
retraceVariable(String variable,
int lineNumber)
Resolve a variable from the interpreter context, returning null if not found.
|
public static final String INSERT_FLAG
public static final String BLOCK_STUB_START
public static final String BLOCK_STUB_END
public JinjavaInterpreter(Jinjava application, Context context, JinjavaConfig renderConfig)
public JinjavaInterpreter(JinjavaInterpreter orig)
public JinjavaConfig getConfiguration()
public void addExtendParentRoot(Node root)
public void addBlock(String name, LinkedList<? extends Node> value)
public void enterScope()
public void leaveScope()
public Object retraceVariable(String variable, int lineNumber)
variable
- name of variable in contextlineNumber
- current line number, for error reportingpublic Object resolveObject(String variable, int lineNumber)
variable
- name of variable in contextlineNumber
- current line number, for error reportingpublic String resolveString(String variable, int lineNumber)
variable
- name of variable in contextlineNumber
- current line number, for error reportingpublic Context getContext()
public String getResource(String resource) throws IOException
IOException
public JinjavaConfig getConfig()
public Object resolveELExpression(String expression, int lineNumber)
expression
- Jinja expression.lineNumber
- Line number of expression.public Object resolveProperty(Object object, String propertyName)
object
- Bean.propertyName
- Name of property to resolve.public Object resolveProperty(Object object, List<String> propertyNames)
object
- Bean.propertyNames
- Names of properties to resolve recursively.public int getLineNumber()
public void addError(TemplateError templateError)
public List<TemplateError> getErrors()
public static JinjavaInterpreter getCurrent()
public static void pushCurrent(JinjavaInterpreter interpreter)
public static void popCurrent()
Copyright © 2015. All rights reserved.