public class CompositeStringExpression extends Object implements Expression
"Hello ${getName()}"
which will be represented as a CompositeStringExpression of two parts. The first part
being a LiteralExpression representing 'Hello ' and the second part being a real
expression that will call getName() when invoked.| Constructor and Description |
|---|
CompositeStringExpression(String expressionString,
Expression[] expressions) |
| Modifier and Type | Method and Description |
|---|---|
Expression[] |
getExpressions() |
String |
getExpressionString()
Return the original string used to create this expression (unmodified).
|
String |
getValue()
Evaluate this expression in the default standard context.
|
<T> T |
getValue(Class<T> expectedResultType)
Evaluate the expression in the default context.
|
String |
getValue(EvaluationContext context)
Evaluate this expression in the provided context and return the result
of evaluation.
|
<T> T |
getValue(EvaluationContext context,
Class<T> expectedResultType)
Evaluate the expression in a specified context which can resolve references
to properties, methods, types, etc.
|
String |
getValue(EvaluationContext context,
Object rootObject)
Evaluate this expression in the provided context and return the result
of evaluation, but use the supplied root context as an override for any
default root object specified in the context.
|
<T> T |
getValue(EvaluationContext context,
Object rootObject,
Class<T> desiredResultType)
Evaluate the expression in a specified context which can resolve references
to properties, methods, types, etc.
|
String |
getValue(Object rootObject)
Evaluate this expression against the specified root object.
|
<T> T |
getValue(Object rootObject,
Class<T> desiredResultType)
Evaluate the expression in the default context against the specified root
object.
|
Class<?> |
getValueType()
Return the most general type that can be passed to a
Expression.setValue(java.lang.Object, java.lang.Object)
method using the default context. |
Class<?> |
getValueType(EvaluationContext context)
Return the most general type that can be passed to the
Expression.setValue(EvaluationContext, Object) method for the given context. |
Class<?> |
getValueType(EvaluationContext context,
Object rootObject)
Return the most general type that can be passed to the
Expression.setValue(EvaluationContext, Object, Object) method for the given
context. |
Class<?> |
getValueType(Object rootObject)
Return the most general type that can be passed to the
Expression.setValue(Object, Object) method using the default context. |
org.springframework.core.convert.TypeDescriptor |
getValueTypeDescriptor()
Return the most general type that can be passed to a
Expression.setValue(java.lang.Object, java.lang.Object)
method using the default context. |
org.springframework.core.convert.TypeDescriptor |
getValueTypeDescriptor(EvaluationContext context)
Return the most general type that can be passed to the
Expression.setValue(EvaluationContext, Object) method for the given context. |
org.springframework.core.convert.TypeDescriptor |
getValueTypeDescriptor(EvaluationContext context,
Object rootObject)
Return the most general type that can be passed to the
Expression.setValue(EvaluationContext, Object, Object) method for the given
context. |
org.springframework.core.convert.TypeDescriptor |
getValueTypeDescriptor(Object rootObject)
Return the most general type that can be passed to the
Expression.setValue(Object, Object) method using the default context. |
boolean |
isWritable(EvaluationContext context)
Determine if an expression can be written to, i.e.
|
boolean |
isWritable(EvaluationContext context,
Object rootObject)
Determine if an expression can be written to, i.e.
|
boolean |
isWritable(Object rootObject)
Determine if an expression can be written to, i.e.
|
void |
setValue(EvaluationContext context,
Object value)
Set this expression in the provided context to the value provided.
|
void |
setValue(EvaluationContext context,
Object rootObject,
Object value)
Set this expression in the provided context to the value provided.
|
void |
setValue(Object rootObject,
Object value)
Set this expression in the provided context to the value provided.
|
public CompositeStringExpression(String expressionString, Expression[] expressions)
public final String getExpressionString()
ExpressiongetExpressionString in interface Expressionpublic final Expression[] getExpressions()
public String getValue() throws EvaluationException
ExpressiongetValue in interface ExpressionEvaluationException - if there is a problem during evaluationpublic <T> T getValue(Class<T> expectedResultType) throws EvaluationException
ExpressiongetValue in interface ExpressionexpectedResultType - the class the caller would like the result to beEvaluationException - if there is a problem during evaluationpublic String getValue(Object rootObject) throws EvaluationException
ExpressiongetValue in interface ExpressionrootObject - the root object against which to evaluate the expressionEvaluationException - if there is a problem during evaluationpublic <T> T getValue(Object rootObject, Class<T> desiredResultType) throws EvaluationException
ExpressiongetValue in interface ExpressionrootObject - the root object against which to evaluate the expressiondesiredResultType - the class the caller would like the result to beEvaluationException - if there is a problem during evaluationpublic String getValue(EvaluationContext context) throws EvaluationException
ExpressiongetValue in interface Expressioncontext - the context in which to evaluate the expressionEvaluationException - if there is a problem during evaluationpublic <T> T getValue(EvaluationContext context, Class<T> expectedResultType) throws EvaluationException
ExpressiongetValue in interface Expressioncontext - the context in which to evaluate the expressionexpectedResultType - the class the caller would like the result to beEvaluationException - if there is a problem during evaluationpublic String getValue(EvaluationContext context, Object rootObject) throws EvaluationException
ExpressiongetValue in interface Expressioncontext - the context in which to evaluate the expressionrootObject - the root object against which to evaluate the expressionEvaluationException - if there is a problem during evaluationpublic <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) throws EvaluationException
ExpressiongetValue in interface Expressioncontext - the context in which to evaluate the expressionrootObject - the root object against which to evaluate the expressiondesiredResultType - the class the caller would like the result to beEvaluationException - if there is a problem during evaluationpublic Class<?> getValueType()
ExpressionExpression.setValue(java.lang.Object, java.lang.Object)
method using the default context.getValueType in interface Expressionpublic Class<?> getValueType(EvaluationContext context)
ExpressionExpression.setValue(EvaluationContext, Object) method for the given context.getValueType in interface Expressioncontext - the context in which to evaluate the expressionpublic Class<?> getValueType(Object rootObject) throws EvaluationException
ExpressionExpression.setValue(Object, Object) method using the default context.getValueType in interface ExpressionrootObject - the root object against which to evaluate the expressionEvaluationException - if there is a problem determining the typepublic Class<?> getValueType(EvaluationContext context, Object rootObject) throws EvaluationException
ExpressionExpression.setValue(EvaluationContext, Object, Object) method for the given
context. The supplied root object overrides any specified in the context.getValueType in interface Expressioncontext - the context in which to evaluate the expressionrootObject - the root object against which to evaluate the expressionEvaluationException - if there is a problem determining the typepublic org.springframework.core.convert.TypeDescriptor getValueTypeDescriptor()
ExpressionExpression.setValue(java.lang.Object, java.lang.Object)
method using the default context.getValueTypeDescriptor in interface Expressionpublic org.springframework.core.convert.TypeDescriptor getValueTypeDescriptor(Object rootObject) throws EvaluationException
ExpressionExpression.setValue(Object, Object) method using the default context.getValueTypeDescriptor in interface ExpressionrootObject - the root object against which to evaluate the expressionEvaluationException - if there is a problem determining the typepublic org.springframework.core.convert.TypeDescriptor getValueTypeDescriptor(EvaluationContext context)
ExpressionExpression.setValue(EvaluationContext, Object) method for the given context.getValueTypeDescriptor in interface Expressioncontext - the context in which to evaluate the expressionpublic org.springframework.core.convert.TypeDescriptor getValueTypeDescriptor(EvaluationContext context, Object rootObject) throws EvaluationException
ExpressionExpression.setValue(EvaluationContext, Object, Object) method for the given
context. The supplied root object overrides any specified in the context.getValueTypeDescriptor in interface Expressioncontext - the context in which to evaluate the expressionrootObject - the root object against which to evaluate the expressionEvaluationException - if there is a problem determining the typepublic boolean isWritable(Object rootObject) throws EvaluationException
ExpressionisWritable in interface ExpressionrootObject - the root object against which to evaluate the expressiontrue if the expression is writable; false otherwiseEvaluationException - if there is a problem determining if it is writablepublic boolean isWritable(EvaluationContext context)
ExpressionisWritable in interface Expressioncontext - the context in which the expression should be checkedtrue if the expression is writable; false otherwisepublic boolean isWritable(EvaluationContext context, Object rootObject) throws EvaluationException
ExpressionisWritable in interface Expressioncontext - the context in which the expression should be checkedrootObject - the root object against which to evaluate the expressiontrue if the expression is writable; false otherwiseEvaluationException - if there is a problem determining if it is writablepublic void setValue(Object rootObject, Object value) throws EvaluationException
ExpressionsetValue in interface ExpressionrootObject - the root object against which to evaluate the expressionvalue - the new valueEvaluationException - if there is a problem during evaluationpublic void setValue(EvaluationContext context, Object value) throws EvaluationException
ExpressionsetValue in interface Expressioncontext - the context in which to set the value of the expressionvalue - the new valueEvaluationException - if there is a problem during evaluationpublic void setValue(EvaluationContext context, Object rootObject, Object value) throws EvaluationException
ExpressionsetValue in interface Expressioncontext - the context in which to set the value of the expressionrootObject - the root object against which to evaluate the expressionvalue - the new valueEvaluationException - if there is a problem during evaluation