public class ELEvaluator extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ELEvaluator.Context
Provides functions and variables for the EL evaluator.
|
| Constructor and Description |
|---|
ELEvaluator()
Creates an ELEvaluator with no functions and no variables defined.
|
ELEvaluator(ELEvaluator.Context context)
Creates an ELEvaluator with the functions and variables defined in the given
ELEvaluator.Context. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkForExistence(java.lang.String expr,
java.lang.String sequence)
Check if the input expression contains sequence statically.
|
<T> T |
evaluate(java.lang.String expr,
java.lang.Class<T> clazz)
Evaluate an EL expression.
|
ELEvaluator.Context |
getContext()
Return the context with the functions and variables of the EL evaluator.
|
static ELEvaluator |
getCurrent()
If within the scope of a EL evaluation call, it gives access to the ELEvaluator instance performing the EL
evaluation.
|
java.lang.Object |
getVariable(java.lang.String name)
Convenience method that returns a variable from the EL evaluator context.
|
void |
setVariable(java.lang.String name,
java.lang.Object value)
Convenience method that sets a variable in the EL evaluator context.
|
public ELEvaluator()
public ELEvaluator(ELEvaluator.Context context)
ELEvaluator.Context. context - the ELSupport with functions and variables to be available for EL evalution.public static ELEvaluator getCurrent()
null if none.public ELEvaluator.Context getContext()
public void setVariable(java.lang.String name, java.lang.Object value)
name - variable name.value - variable value.public java.lang.Object getVariable(java.lang.String name)
name - variable name.null if not defined.public <T> T evaluate(java.lang.String expr, java.lang.Class<T> clazz) throws java.lang.Exception
expr - EL expression to evaluate.clazz - return type of the EL expression.java.lang.Exception - thrown if an EL function failed due to a transient error or EL expression could not be
evaluated.public boolean checkForExistence(java.lang.String expr, java.lang.String sequence) throws java.lang.Exception
expr - - Expression stringsequence - - char sequence to check in the input expressionjava.lang.Exception - Exception thrown if an EL function failed due to a
transient error or EL expression could not be parsedCopyright © 2017 Apache Software Foundation. All Rights Reserved.