public abstract class UnifiedJEXL.Expression extends Object
Modifier and Type | Field and Description |
---|---|
protected UnifiedJEXL.Expression |
source
The source of this expression (see
prepare(edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.JexlContext) ). |
Modifier and Type | Method and Description |
---|---|
String |
asString()
Generates this expression's string representation.
|
abstract StringBuilder |
asString(StringBuilder strb)
Adds this expression's string representation to a StringBuilder.
|
protected abstract Object |
evaluate(Interpreter interpreter)
Intreprets a sub-expression.
|
Object |
evaluate(JexlContext context)
Evaluates this expression.
|
UnifiedJEXL.Expression |
getSource()
Retrieves this expression's source expression.
|
Set<List<String>> |
getVariables()
Gets the list of variables accessed by this expression.
|
protected void |
getVariables(Set<List<String>> refs)
Fills up the list of variables accessed by this expression.
|
boolean |
isDeferred()
Checks whether this expression is deferred.
|
boolean |
isImmediate()
Checks whether this expression is immediate.
|
protected UnifiedJEXL.Expression |
prepare(Interpreter interpreter)
Prepares a sub-expression for interpretation.
|
UnifiedJEXL.Expression |
prepare(JexlContext context)
Evaluates the immediate sub-expressions.
|
String |
toString()
Formats this expression, adding its source string representation in
comments if available: 'expression /*= source *\/'' .
|
protected final UnifiedJEXL.Expression source
prepare(edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.JexlContext)
).public boolean isImmediate()
public final boolean isDeferred()
public String toString()
public String asString()
public abstract StringBuilder asString(StringBuilder strb)
strb
- the builder to fillpublic Set<List<String>> getVariables()
This method will visit all nodes of the sub-expressions and extract all variables whether they are written in 'dot' or 'bracketed' notation. (a.b is equivalent to a['b']).
protected void getVariables(Set<List<String>> refs)
refs
- the set of variable being filledpublic UnifiedJEXL.Expression prepare(JexlContext context)
When the expression is dependant upon immediate and deferred sub-expressions, evaluates the immediate sub-expressions with the context passed as parameter and returns this expression deferred form.
In effect, this binds the result of the immediate sub-expressions evaluation in the context, allowing to differ evaluation of the remaining (deferred) expression within another context. This only has an effect to nested & composite expressions that contain differed & immediate sub-expressions.
If the underlying JEXL engine is silent, errors will be logged through its logger as warning.
Note: do not override; will be made final in a future release.context
- the context to use for immediate expression evaluationsJexlEngine
is running in silent modeUnifiedJEXL.Exception
- if an error occurs and the JexlEngine
is not in silent modepublic Object evaluate(JexlContext context)
If the underlying JEXL engine is silent, errors will be logged through its logger as warning.
Note: do not override; will be made final in a future release.context
- the variable contextJexlEngine
is
running in silent modeUnifiedJEXL.Exception
- if an error occurs and the JexlEngine
is not silentpublic final UnifiedJEXL.Expression getSource()
protected UnifiedJEXL.Expression prepare(Interpreter interpreter)
interpreter
- a JEXL interpreterJexlException
- (only for nested & composite)protected abstract Object evaluate(Interpreter interpreter)
interpreter
- a JEXL interpreterJexlException
- (only for nested & composite)Copyright © 2016 Internet2. All rights reserved.