Package org.forgerock.openig.el
Class Expressions
java.lang.Object
org.forgerock.openig.el.Expressions
Utility class for evaluating expression in some collections.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Promise<Object,
NeverThrowsException> evaluateAsync
(Object value, Bindings bindings) Evaluate an Object that may contain some expressions that needs to be evaluated.static Promise<List<Object>,
NeverThrowsException> evaluateAsync
(List<Object> list, Bindings bindings) Evaluate a list that may contain some Expressions that needs to be evaluated.static Promise<Map<String,
Object>, NeverThrowsException> evaluateAsync
(Map<String, Object> map, Bindings bindings) Evaluate a map that may contain some expressions that needs to be evaluated.static Object
Compile to expression an Object that may contain some String that needs to be evaluated.static Object
Compile to expression an Object that may contain some String that needs to be evaluated.static Expression<Object>
Convert a String to a compiled expression.static Expression<Object>
Convert a String to a compiled expression.Compile as expressions what can be compiled in a list.Compile as expressions what can be compiled in a list.Compile a map that may contain some values that needs to be transformed as expression.Compile a map that may contain some values that needs to be transformed as expression.
-
Method Details
-
evaluateAsync
public static Promise<Map<String,Object>, evaluateAsyncNeverThrowsException> (Map<String, Object> map, Bindings bindings) Evaluate a map that may contain some expressions that needs to be evaluated.- Parameters:
map
- the map to evaluatebindings
- the bindings used for the evaluation- Returns:
- a promise of a new Map containing the result of the evaluation.
-
evaluateAsync
public static Promise<List<Object>,NeverThrowsException> evaluateAsync(List<Object> list, Bindings bindings) Evaluate a list that may contain some Expressions that needs to be evaluated.- Parameters:
list
- the list to evaluatebindings
- the bindings used for the evaluation- Returns:
- a promise of a new list containing the results of the evaluations
-
evaluateAsync
Evaluate an Object that may contain some expressions that needs to be evaluated. The supported types of Object are : String, List and Map.- Parameters:
value
- the String to evaluatebindings
- the bindings used for the evaluation- Returns:
- the result of the evaluation.
-
from
Compile a map that may contain some values that needs to be transformed as expression.- Parameters:
map
- the map containing potential expressions- Returns:
- a new Map containing expressions when possible.
- Throws:
ExpressionException
- if an error occurs while compiling the expression
-
from
public static Map<String,Object> from(Map<String, Object> map, Bindings initialBindings) throws ExpressionExceptionCompile a map that may contain some values that needs to be transformed as expression.- Parameters:
map
- the map containing potential expressionsinitialBindings
- the initial bindings to use when the expression will be evaluated- Returns:
- a new Map containing expressions when possible.
- Throws:
ExpressionException
- if an error occurs while compiling the expression
-
from
Compile as expressions what can be compiled in a list.- Parameters:
list
- the list to convert to expressions- Returns:
- a promise of a new list containing the results of the evaluations
- Throws:
ExpressionException
- if an error occurs while evaluating the expression
-
from
public static List<Object> from(List<Object> list, Bindings initialBindings) throws ExpressionException Compile as expressions what can be compiled in a list.- Parameters:
list
- the list to convert to expressionsinitialBindings
- the initial bindings to use when the expression will be evaluated- Returns:
- a promise of a new list containing the results of the evaluations
- Throws:
ExpressionException
- if an error occurs while evaluating the expression
-
from
Convert a String to a compiled expression.- Parameters:
value
- the String to compile as expression- Returns:
- the corresponding compiled expression
- Throws:
ExpressionException
- if an error occurs while compiling the expression
-
from
public static Expression<Object> from(String value, Bindings initialBindings) throws ExpressionException Convert a String to a compiled expression.- Parameters:
value
- the String to compile as expressioninitialBindings
- the initial bindings to use when the expression will be evaluated- Returns:
- the corresponding compiled expression
- Throws:
ExpressionException
- if an error occurs while compiling the expression
-
from
Compile to expression an Object that may contain some String that needs to be evaluated. The supported types of Object are : String, List and Map.- Parameters:
value
- the Object to compile to expression- Returns:
- the result of the compilation. Or the object itself if it has an unsupported type
- Throws:
ExpressionException
- if an error occurs while evaluating the expression
-
from
Compile to expression an Object that may contain some String that needs to be evaluated. The supported types of Object are : String, List and Map.- Parameters:
value
- the Object to compile to expressioninitialBindings
- the initial bindings to use when the expression will be evaluated- Returns:
- the result of the compilation. Or the object itself if it has an unsupported type
- Throws:
ExpressionException
- if an error occurs while evaluating the expression
-