public final class ExpressionEngine extends Object
| Modifier and Type | Method and Description |
|---|---|
static Expression |
compileExpression(String expression,
ExpressionContext expressionContext,
boolean validate)
Compiles the expression string and prepares the expression tree with
relevant Expression's objects.
|
static Object |
evaluate(String expression,
ExpressionContext expressionContext)
Evaluates the expression and returns the result
|
static Grammar |
getGrammar() |
static Set<String> |
getVariableNames(String expression)
Retrieves a set of variable names contained within the specified expression string
|
static void |
main(String[] args) |
public static Grammar getGrammar()
public static Object evaluate(String expression, ExpressionContext expressionContext) throws ExpressionEngineException
expression - the expression to evaluateexpressionContext - the object contains the contextual information,
which may be required for expression evaluation. It may be like
an Java Bean in case of property expressionExpressionEngineException - if unable to parse the expressionpublic static Expression compileExpression(String expression, ExpressionContext expressionContext, boolean validate) throws ExpressionEngineException
expression - the expression to compileexpressionContext - the object contains the contextual information,
which may be required for expression evaluation. It may be like
an Java Bean in case of property expressionvalidate - true if the operands should be validatedExpressionEngineException - if unable to compile the expressionpublic static Set<String> getVariableNames(String expression) throws ExpressionEngineException
expression - the expression to extract the variable names forExpressionEngineExceptionpublic static void main(String[] args) throws ExpressionEngineException
ExpressionEngineException