public class ExpressionEvaluator extends Object
| 构造器和说明 |
|---|
ExpressionEvaluator(String exp,
Class cl)
Create a new expression evaluator.
|
ExpressionEvaluator(String exp,
Class cl,
List fhs)
Create a new expression evaluator.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Query |
getQuery()
Get the query associated with the expression, use this to setup
bind variables, function handlers and so on, which of course must
be setup prior to evaluating the expression.
|
Object |
getValue(Object o)
Evaluate the expression against the object passed in and return the
value.
|
static Object |
getValue(String exp,
Object o)
Evaluate the expression against the object passed in and return the
value.
|
List |
getValues(List l)
Evaluate the expression against the list of objects passed in and
return the value.
|
static List |
getValues(String exp,
List l)
Evaluate the expression against the list of objects passed in and
return the value.
|
boolean |
isTrue(Object o)
Evaluate the expression against the object passed in.
|
static boolean |
isTrue(String exp,
Object o)
Evaluate the expression against the object passed in.
|
public ExpressionEvaluator(String exp, Class cl) throws QueryParseException
exp - The expression to be evaluated.cl - The class of the object(s) that the expression will be
evaluated against.QueryParseException - If the expression cannot be parsed.public ExpressionEvaluator(String exp, Class cl, List fhs) throws QueryParseException
exp - The expression to be evaluated.cl - The class of the object(s) that the expression will be
evaluated against.fhs - A list of function handlers that contain functions that will
be used by the expression, can be null.QueryParseException - If the expression cannot be parsed.public Query getQuery()
public boolean isTrue(Object o) throws QueryExecutionException
o - The object to evaluate the expression against.QueryExecutionException - If the expression cannot be executed.public List getValues(List l) throws QueryExecutionException
l - The list of objects to evaluate the expression against.QueryExecutionException - If the expression cannot be executed.public Object getValue(Object o) throws QueryExecutionException
o - The object to evaluate the expression against.QueryExecutionException - If the expression cannot be executed.public static boolean isTrue(String exp, Object o) throws QueryParseException, QueryExecutionException
exp - A string representation of the expression to evaluate.o - The object to evaluate the expression against.QueryParseException - If the expression cannot be parsed.QueryExecutionException - If the expression cannot be executed.public static List getValues(String exp, List l) throws QueryParseException, QueryExecutionException
exp - A string representation of the expression to evaluate.l - The list of objects to evaluate the expression against.QueryParseException - If the expression cannot be parsed.QueryExecutionException - If the expression cannot be executed.public static Object getValue(String exp, Object o) throws QueryParseException, QueryExecutionException
exp - A string representation of the expression to evaluate.o - The object to evaluate the expression against.QueryParseException - If the expression cannot be parsed.QueryExecutionException - If the expression cannot be executed.Copyright © 2021. All rights reserved.