|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.jelly.expression.ExpressionSupport org.apache.commons.jelly.expression.CompositeExpression
public class CompositeExpression
CompositeExpression
is a Composite expression made up of several
Expression objects which are concatenated into a single String.
Field Summary | |
---|---|
private java.util.List |
expressions
The expressions |
Fields inherited from class org.apache.commons.jelly.expression.ExpressionSupport |
---|
EMPTY_ITERATOR |
Constructor Summary | |
---|---|
CompositeExpression()
|
|
CompositeExpression(java.util.List expressions)
|
Method Summary | |
---|---|
void |
addExpression(Expression expression)
Adds a new expression to the end of the expression list |
void |
addTextExpression(java.lang.String text)
A helper method to add a new constant text expression |
java.lang.Object |
evaluate(JellyContext context)
Evaluates the expression with the given context and returns the result |
java.util.Iterator |
evaluateAsIterator(JellyContext context)
Evaluates the expression with the given context coercing the result to be an Iterator. |
java.lang.String |
evaluateAsString(JellyContext context)
Evaluates the expression with the given context coercing the result to be a String. |
java.util.List |
getExpressions()
|
java.lang.String |
getExpressionText()
|
static Expression |
parse(java.lang.String text,
ExpressionFactory factory)
Parses the given String to be either a ConstantExpresssion, an Expression denoted as "${foo}" or some String with embedded expresssions such as "abc${something}def${else}xyz" which results in a CompositeExpression being returned. |
void |
setExpressions(java.util.List expressions)
Sets the Expression objects that make up this composite expression |
java.lang.String |
toString()
|
Methods inherited from class org.apache.commons.jelly.expression.ExpressionSupport |
---|
evaluateAsBoolean, evaluateRecurse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.List expressions
Constructor Detail |
---|
public CompositeExpression()
public CompositeExpression(java.util.List expressions)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public static Expression parse(java.lang.String text, ExpressionFactory factory) throws JellyException
text
- is the String to parse into expressionsfactory
- is the Factory of Expression objects used to create expresssions 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 java.util.List getExpressions()
public void setExpressions(java.util.List expressions)
public void addExpression(Expression expression)
public void addTextExpression(java.lang.String text)
public java.lang.String getExpressionText()
public java.lang.Object evaluate(JellyContext context)
Expression
public java.lang.String evaluateAsString(JellyContext context)
Expression
evaluateAsString
in interface Expression
evaluateAsString
in class ExpressionSupport
public java.util.Iterator evaluateAsIterator(JellyContext context)
Expression
evaluateAsIterator
in interface Expression
evaluateAsIterator
in class ExpressionSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |