public class CompositeExpression extends ExpressionSupport
CompositeExpression
is a Composite expression made up of several
Expression objects which are concatenated into a single String.
EMPTY_ITERATOR
NULL
Constructor and Description |
---|
CompositeExpression() |
CompositeExpression(List expressions) |
Modifier and Type | Method and Description |
---|---|
void |
addExpression(Expression expression)
Adds a new expression to the end of the expression list
|
void |
addTextExpression(String text)
A helper method to add a new constant text expression
|
Object |
evaluate(JellyContext context)
Evaluates the expression with the given context
and returns the result
|
Iterator |
evaluateAsIterator(JellyContext context)
Evaluates the expression with the given context
coercing the result to be an Iterator.
|
String |
evaluateAsString(JellyContext context)
Evaluates the expression with the given context
coercing the result to be a String.
|
List |
getExpressions() |
String |
getExpressionText() |
static Expression |
parse(String text,
ExpressionFactory factory)
Parses the given String to be either a ConstantExpression, an Expression denoted as
"${foo}" or some String with embedded expressions such as "abc${something}def${else}xyz"
which results in a CompositeExpression being returned.
|
void |
setExpressions(List expressions)
Sets the Expression objects that make up this
composite expression
|
String |
toString() |
evaluateAsBoolean, evaluateRecurse
public CompositeExpression()
public CompositeExpression(List expressions)
public static Expression parse(String text, ExpressionFactory factory) throws JellyException
text
- is the String to parse into expressionsfactory
- is the Factory of Expression objects used to create expressions for the contents
of the String "foo" inside expressions such as "${foo}"JellyException
- if the text is invalid (such as missing '}' character).JellyException
- if there was some problem creating the underlying Expression object
from the ExpressionFactorypublic List getExpressions()
public void setExpressions(List expressions)
public void addExpression(Expression expression)
public void addTextExpression(String text)
public String getExpressionText()
public Object evaluate(JellyContext context)
Expression
public String evaluateAsString(JellyContext context)
Expression
evaluateAsString
in interface Expression
evaluateAsString
in class ExpressionSupport
public Iterator evaluateAsIterator(JellyContext context)
Expression
evaluateAsIterator
in interface Expression
evaluateAsIterator
in class ExpressionSupport
Copyright © 2014 Apache Software Foundation. All rights reserved.