|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.plotnix.jex.Interpreter
|
+--com.plotnix.jex.MultilingualInterpreter
A MultilingualInterpreter determines the language for each expression and then interprets it using that language's interpreter.
If the expression string passed to this interpreter starts with
"language:", the compiler strips the prefix off and
passes the remainder of the expression to the interpreter for
the corresponding language.
The prefix is required if the MultilingualInterpreter's default language is null.
If the default language is not null and the expression is missing a prefix, or the prefix does not match an existing compiler, the multilingual interpreter passes the expression unchanged to the default language interpreter.
| Method Summary | |
void |
assign(Context context,
java.lang.String expression,
java.lang.Object value,
java.lang.Object[] arguments)
See evaluate |
java.lang.Object |
evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
Evaluates the expression using the appropriate Interpreter. |
java.lang.Object |
evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments,
java.lang.Class valueType)
Evaluates the expression and casts the result to the supplied type. |
static Interpreter |
getMultilingualInterpreter(java.lang.String defaultLanguage)
Returns a MultilingualInterpreter with the specified default language. |
java.util.Iterator |
iterate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
See evaluate |
void |
validateExpression(java.lang.String expression)
Identifies the expression language and validates the expression syntax using the appropriate Interpreter See evaluate |
void |
validateIterationExpression(java.lang.String expression)
Identifies the expression language and validates the iteration expression syntax using the appropriate Interpreter See evaluate |
void |
validateVariableExpression(java.lang.String expression)
Identifies the expression language and validates the variable expression syntax using the appropriate Interpreter See evaluate |
| Methods inherited from class com.plotnix.jex.Interpreter |
getInterpreter, getInterpreterImplementation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final Interpreter getMultilingualInterpreter(java.lang.String defaultLanguage)
defaultLanguage - is the default language or null
public java.lang.Object evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
evaluate in class Interpretercontext - is the context in which the expression should be
evaluatedexpression - is the expression to be evaluated with
an optional "lang:" prefixarguments - is an array of arguments for the expression. Can
be null if the expression does not require any arguments.
public java.lang.Object evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments,
java.lang.Class valueType)
evaluate in class Interpreterevaluate(Context, String, Object[])
public java.util.Iterator iterate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
evaluateiterate in class InterpreterInterpreter.iterate(Context, String, Object[])
public void assign(Context context,
java.lang.String expression,
java.lang.Object value,
java.lang.Object[] arguments)
evaluateassign in class InterpreterInterpreter.assign(Context, String, Object, Object[])public void validateExpression(java.lang.String expression)
evaluatevalidateExpression in class InterpreterInterpreter.validateExpression(String)public void validateIterationExpression(java.lang.String expression)
evaluatevalidateIterationExpression in class InterpreterInterpreter.validateIterationExpression(String)public void validateVariableExpression(java.lang.String expression)
evaluatevalidateVariableExpression in class InterpreterInterpreter.validateIterationExpression(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||