public interface Evaluator
Modifier and Type | Field and Description |
---|---|
static String |
CLASSLOADER_VARIABLE
Variable name for classloader instance.
|
static String |
GLOBAL_VARIABLE |
static String |
MATH_CONTEXT_VARIABLE |
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(Object instance,
String attributeName) |
Context |
getContext() |
Object |
getDefaultExpression() |
Locale |
getLocale() |
String |
getLocaleKey()
A locale key, default value is
getLocale() .getLanguage().toUpperCase()}. |
Writer |
getOut() |
String |
getStack() |
Printable |
getTemplate(String type,
String name,
Map<String,Object> params) |
String |
getTopStackElement()
The currently evaluated stack element as string - for debugging.
|
Object |
getVariableValue(String variableName) |
void |
include(String type,
Object toInclude,
Map<String,Object> params) |
Object |
invokeMethod(Object instance,
String methodName,
List<Object> args) |
boolean |
isDebugging() |
void |
logDebug(String message) |
void |
logError(int line,
int col,
String message) |
void |
logError(int line,
int col,
String message,
Throwable t) |
void |
logError(String message) |
void |
logError(String message,
Throwable throwable) |
void |
logInfo(String message) |
void |
logWarning(String message) |
TemplateDocument |
parse(Reader source) |
TemplateDocument |
parse(String source) |
Context |
popContext() |
void |
print(Object value)
Print an object instance to the
output . |
void |
print(Printable template) |
void |
pushContext(Context context)
Set a new top context.
|
Context |
pushContext(String name)
Will push a new context.
|
Context |
pushContext(String name,
Object target)
Will push a new context and set the target object as #this.
|
Context |
pushContext(String name,
String info)
Will push a new context and an info text on the stack
|
Object |
resolveReference(List<Object> params,
Map<String,Object> namedParams) |
void |
setDefaultExpression(Object value) |
void |
setErrorOut(PrintWriter out) |
void |
setErrorOut(Writer out)
Shortcut for
setErrorOut(new PrintWriter(out)) . |
void |
setLocale(Locale value) |
void |
setLocaleKey(String value) |
void |
setMaxStackSize(int value) |
void |
setOut(Writer out) |
void |
setVariableValue(String variableName,
Object value) |
static final String MATH_CONTEXT_VARIABLE
static final String GLOBAL_VARIABLE
static final String CLASSLOADER_VARIABLE
Object resolveReference(List<Object> params, Map<String,Object> namedParams) throws Exception
Exception
void include(String type, Object toInclude, Map<String,Object> params) throws IOException
IOException
Object getAttribute(Object instance, String attributeName) throws Exception
Exception
Object invokeMethod(Object instance, String methodName, List<Object> args) throws Exception
Exception
void print(Object value) throws IOException
output
.value
- objectIOException
Context getContext()
void setLocale(Locale value)
Locale getLocale()
String getLocaleKey()
getLocale()
.getLanguage().toUpperCase()}.setLocaleKey(String)
void setLocaleKey(String value)
getLocaleKey()
void logError(String message)
void logError(int line, int col, String message)
void logWarning(String message)
void logInfo(String message)
void logDebug(String message)
Context pushContext(String name, String info)
name
- the name of the new contextinfo
- the text wich is put on the context stackpushContext(Context)
Context pushContext(String name)
pushContext(Context)
for further informations.name
- the name of the new contextpushContext(Context)
Context pushContext(String name, Object target)
name
- The name of the new context.target
- The target object the context operates on.pushContext(String)
void pushContext(Context context)
Context.setParentContext(Context)
on the provided
context object. try .. finally
block:
evaluator.pushContext(myContext) try { ... } finally { evaluator.popContext(); }
context
- the new top context, null
is not allowedpopContext()
Context popContext()
pushContext(Context)
Writer getOut()
void setOut(Writer out)
void setErrorOut(Writer out)
setErrorOut(new PrintWriter(out))
.void setErrorOut(PrintWriter out)
void print(Printable template) throws IOException
IOException
Printable getTemplate(String type, String name, Map<String,Object> params) throws IOException
IOException
String getStack()
String getTopStackElement()
void setDefaultExpression(Object value)
Object getDefaultExpression()
void setMaxStackSize(int value)
TemplateDocument parse(String source)
TemplateDocument parse(Reader source) throws IOException
IOException
boolean isDebugging()
Copyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500