|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.plotnix.jex.Context
Expressions are evaluated in a Context, which provides access to shared pieces of the environment: variables, locale, expression language compilers etc.
Constructor Summary | |
Context()
Creates a new Context |
|
Context(Context parentContext)
Creates a new Context with the given parent Context. |
Method Summary | |
void |
assign(java.lang.String expression,
java.lang.Object value,
java.lang.Object[] arguments)
Invokes the context's interpreter to modify the value described by the supplied left-hand side expression. |
java.lang.Object |
evaluate(java.lang.String expression,
java.lang.Object[] arguments)
Invokes the context's interpreter to evaluate the supplied expression. |
java.lang.Object |
evaluate(java.lang.String expression,
java.lang.Object[] arguments,
java.lang.Class valueType)
Evaluates the expression and casts the result to the supplied type. |
java.lang.Object |
findProperty(java.lang.String property)
Returns the value of the specified property. |
Compiler |
getCompiler()
Returns the compiler for the Context's expression language or a multilingual compiler if the Context is multilingual. |
java.lang.String |
getExpressionLanguage()
Returns the name of this context's (default) expression language. |
Interpreter |
getInterpreter()
Returns the interpreter for the Context's expression language or a multilingual interpreter if the Context is multilingual. |
java.util.Locale |
getLocale()
Returns the locale set with setLocale or, if none was set parent context's locale or Locale.getDefault(). |
Context |
getParentContext()
Returns the Context's parent. |
java.lang.Object |
getProperty(java.lang.String property)
Returns the value of the specified property. |
Variables |
getVariables()
Returns the variable pool associated with the context. |
boolean |
isMultilingual()
Returns true if the Context is multilingual . |
java.util.Iterator |
iterate(java.lang.String expression,
java.lang.Object[] arguments)
Invokes the context's interpreter to evaluate the supplied iteration expression. |
void |
setExpressionLanguage(java.lang.String language)
Set the name of the expression language for this context. |
void |
setLocale(java.util.Locale locale)
Set the locale for this context. |
void |
setMultilingual(boolean multilingual)
If set to true, this context will support multiple expression languages. |
void |
setProperty(java.lang.String property,
java.lang.Object value)
Sets a configuration property that can be used by expression language implementations. |
void |
setVariables(Variables variables)
Install a custom implementation of a Variable pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Context()
public Context(Context parentContext)
parentContext
- is the parent contextMethod Detail |
public Context getParentContext()
public void setExpressionLanguage(java.lang.String language)
setMultilingual
), this language will
function as the default - expressions in this language will
not require a "lang"
prefix.language
- is the name of an expression language. The compiler for
this language should be available.public java.lang.String getExpressionLanguage()
public void setMultilingual(boolean multilingual)
"lang:"
prefix. If the default expression
language has been specified, the expressions in that language
do not require a language prefix.multilingual
- is the new settingpublic boolean isMultilingual()
multilingual
.setMultilingual(boolean)
public Compiler getCompiler()
Will throw an exception if the Context is not multilingual and the expression language has not been specified.
Compiler
,
MultilingualCompiler
public Interpreter getInterpreter()
Will throw an exception if the Context is not multilingual and the expression language has not been specified.
Interpreter
,
MultilingualInterpreter
public void setProperty(java.lang.String property, java.lang.Object value)
property
- is the name of of the propertyvalue
- is the value of the propertypublic java.lang.Object getProperty(java.lang.String property)
property
- is a property namepublic java.lang.Object findProperty(java.lang.String property)
property
- is a property namepublic void setVariables(Variables variables)
variables
- are custom Variablespublic Variables getVariables()
public void setLocale(java.util.Locale locale)
Locale.getDefault()
locale
- is the locale this context is associated withpublic java.util.Locale getLocale()
public java.lang.Object evaluate(java.lang.String expression, java.lang.Object[] arguments)
expression
- is the expression that needs to be evaluatedarguments
- are argument of the expression. Can be null
if the expression does not take any arguments.getInterpreter()
public java.lang.Object evaluate(java.lang.String expression, java.lang.Object[] arguments, java.lang.Class valueType)
evaluate(String, Object[])
public java.util.Iterator iterate(java.lang.String expression, java.lang.Object[] arguments)
expression
- is the expression that needs to be evaluatedarguments
- are argument of the expression. Can be null
if the expression does not take any arguments.getInterpreter()
public void assign(java.lang.String expression, java.lang.Object value, java.lang.Object[] arguments)
expression
- is the expression that needs to be evaluatedvalue
- is the new valuearguments
- are argument of the expression. Can be null
if the expression does not take any arguments.getInterpreter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |