|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.oozie.util.ELEvaluator
public class ELEvaluator
JSP Expression Language Evaluator.
It provides a more convenient way of using the JSP EL Evaluator.
Nested Class Summary | |
---|---|
static class |
ELEvaluator.Context
Provides functions and variables for the EL evaluator. |
Constructor Summary | |
---|---|
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 . |
Method Summary | ||
---|---|---|
boolean |
checkForExistence(String expr,
String sequence)
Check if the input expression contains sequence statically. |
|
|
evaluate(String expr,
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. |
|
Object |
getVariable(String name)
Convenience method that returns a variable from the EL evaluator context. |
|
void |
setVariable(String name,
Object value)
Convenience method that sets a variable in the EL evaluator context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ELEvaluator()
public ELEvaluator(ELEvaluator.Context context)
ELEvaluator.Context
.
context
- the ELSupport with functions and variables to be available for EL evalution.Method Detail |
---|
public static ELEvaluator getCurrent()
This is useful for EL function methods to get access to the variables of the Evaluator. Because of this, ELEvaluator variables can be used to pass context to EL function methods (which must be static methods).
null
if none.public ELEvaluator.Context getContext()
public void setVariable(String name, Object value)
name
- variable name.value
- variable value.public Object getVariable(String name)
name
- variable name.
null
if not defined.public <T> T evaluate(String expr, Class<T> clazz) throws Exception
expr
- EL expression to evaluate.clazz
- return type of the EL expression.
Exception
- thrown if an EL function failed due to a transient error or EL expression could not be
evaluated.public boolean checkForExistence(String expr, String sequence) throws Exception
expr
- - Expression stringsequence
- - char sequence to check in the input expression
Exception
- Exception thrown if an EL function failed due to a
transient error or EL expression could not be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |