public final class JexlUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_EXPRESSION_PATTERN
The default expression pattern matching expressions in the form ${el}.
|
| Modifier and Type | Method and Description |
|---|---|
static org.apache.commons.jexl.Expression |
createExpression(String expression)
Convert expressions into valid JexlExpressions, if the string does not
contain any expressions in the form ${el} then null will be returned and
the caller can use the raw string.
|
static org.apache.commons.jexl.Expression |
createExpression(String expression,
String expressionPattern)
Convert expressions into valid JexlExpressions, if the string does not
contain any expressions that match the expressionPattern then null will be
returned and the caller can use the raw string.
|
static Object |
evaluateExpression(org.apache.commons.jexl.JexlContext context,
org.apache.commons.jexl.Expression expression) |
public static final String DEFAULT_EXPRESSION_PATTERN
public static org.apache.commons.jexl.Expression createExpression(String expression) throws Exception
expression - The string containing expressions.Exception - If there was an error creating the expression.public static org.apache.commons.jexl.Expression createExpression(String expression, String expressionPattern) throws Exception
Convert expressions into valid JexlExpressions, if the string does not contain any expressions that match the expressionPattern then null will be returned and the caller can use the raw string.
The expressionPattern can be used to define an alternate pattern than the
DEFAULT_EXPRESSION_PATTERN that defines expressions in the form
${el}. The pattern is defined as a Java Regular expression. The contents of
the expression part of the pattern must be enclosed in () to define the
group. The characters outside the first group will be removed from the
string and the expression portion will be added to the expression.
expression - The string containing expressions.expressionPattern - The regular expression pattern used to identify
expressions in the string. The first group in the expression will
be used as the expression.Exception - If there was an error creating the expression.public static Object evaluateExpression(org.apache.commons.jexl.JexlContext context, org.apache.commons.jexl.Expression expression)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.