public class Expression extends Object
Constructor and Description |
---|
Expression(String expression)
Constructs an expression for later evaluation.
|
Modifier and Type | Method and Description |
---|---|
Object |
eval(Object scope)
Evaluates the expression within the specified scope and returns the resulting object, or
null if it does not resolve a value. |
<T> T |
eval(Object scope,
Class<T> type)
Evaluates the expression within the specified scope and returns the resulting object
if it matches the specified type, or
null if it does not resolve or match. |
void |
set(Object scope,
Object value)
Sets the result of an evaluated expression to a specified value.
|
public Expression(String expression) throws ExpressionException
expression
- the expression to parse.ExpressionException
- if the expression was not syntactically correct.public Object eval(Object scope)
null
if it does not resolve a value.scope
- the scope to evaluate the expression within.null
if does not resolve a value.public <T> T eval(Object scope, Class<T> type)
null
if it does not resolve or match.T
- expected result typescope
- the scope to evaluate the expression within.type
- the type of object the evaluation is expected to yield.null
if it does not resolve or match the type.public void set(Object scope, Object value)
scope
- the scope to evaluate the expression within.value
- the value to set in the result of the expression evaluation.Copyright © 2014 ForgeRock AS. All rights reserved.