T
- expected result typepublic final class Expression<T> extends Object
Modifier and Type | Method and Description |
---|---|
T |
eval()
Convenient method to eval an Expression that does not need a scope.
|
T |
eval(Bindings bindings)
Evaluates the expression within the specified bindings and returns the resulting object if it matches the
specified type, or
null if it does not resolve or match. |
void |
set(Bindings bindings,
Object value)
Sets the result of an evaluated expression to a specified value.
|
String |
toString()
Returns the original string used to create this expression, unmodified.
|
static <T> Expression<T> |
valueOf(String expression,
Class<T> expectedType)
Factory method to create an Expression.
|
public static <T> Expression<T> valueOf(String expression, Class<T> expectedType) throws ExpressionException
T
- expected result typeexpression
- The expression to parse.expectedType
- The expected result type of the expression.ExpressionException
- if the expression was not syntactically correct.public T eval(Bindings bindings)
null
if it does not resolve or match.bindings
- the bindings to evaluate the expression within.null
if it does not resolve or match the type.public T eval()
null
if it does not resolve or match the type.public void set(Bindings bindings, Object value)
bindings
- the bindings to evaluate the expression within.value
- the value to set in the result of the expression evaluation.Copyright 2011-2015 ForgeRock AS.