@ -20,7 +20,6 @@ import org.springframework.core.convert.TypeDescriptor;
@@ -20,7 +20,6 @@ import org.springframework.core.convert.TypeDescriptor;
import org.springframework.expression.EvaluationContext ;
import org.springframework.expression.EvaluationException ;
import org.springframework.expression.Expression ;
import org.springframework.util.ObjectUtils ;
/ * *
* Represents a template expression broken into pieces . Each piece will be an Expression but pure text parts to the
@ -58,27 +57,46 @@ public class CompositeStringExpression implements Expression {
@@ -58,27 +57,46 @@ public class CompositeStringExpression implements Expression {
public String getValue ( ) throws EvaluationException {
StringBuilder sb = new StringBuilder ( ) ;
for ( Expression expression : this . expressions ) {
sb . append ( ObjectUtils . getDisplayString ( expression . getValue ( ) ) ) ;
String value = expression . getValue ( String . class ) ;
if ( value ! = null ) {
sb . append ( value ) ;
}
}
return sb . toString ( ) ;
}
public String getValue ( EvaluationContext contex t) throws EvaluationException {
public String getValue ( Object rootObjec t) throws EvaluationException {
StringBuilder sb = new StringBuilder ( ) ;
for ( Expression expression : this . expressions ) {
sb . append ( ObjectUtils . getDisplayString ( expression . getValue ( context ) ) ) ;
String value = expression . getValue ( rootObject , String . class ) ;
if ( value ! = null ) {
sb . append ( value ) ;
}
}
return sb . toString ( ) ;
}
public String getValue ( Object rootObjec t) throws EvaluationException {
public String getValue ( EvaluationContext contex t) throws EvaluationException {
StringBuilder sb = new StringBuilder ( ) ;
for ( Expression expression : this . expressions ) {
sb . append ( ObjectUtils . getDisplayString ( expression . getValue ( rootObject ) ) ) ;
String value = expression . getValue ( context , String . class ) ;
if ( value ! = null ) {
sb . append ( value ) ;
}
}
return sb . toString ( ) ;
}
public String getValue ( EvaluationContext context , Object rootObject ) throws EvaluationException {
StringBuilder sb = new StringBuilder ( ) ;
for ( Expression expression : this . expressions ) {
String value = expression . getValue ( context , rootObject , String . class ) ;
if ( value ! = null ) {
sb . append ( value ) ;
}
}
return sb . toString ( ) ;
}
public Class getValueType ( EvaluationContext context ) {
return String . class ;
@ -124,14 +142,6 @@ public class CompositeStringExpression implements Expression {
@@ -124,14 +142,6 @@ public class CompositeStringExpression implements Expression {
return ExpressionUtils . convert ( null , value , desiredResultType ) ;
}
public String getValue ( EvaluationContext context , Object rootObject ) throws EvaluationException {
StringBuilder sb = new StringBuilder ( ) ;
for ( Expression expression : this . expressions ) {
sb . append ( ObjectUtils . getDisplayString ( expression . getValue ( context , rootObject ) ) ) ;
}
return sb . toString ( ) ;
}
public < T > T getValue ( EvaluationContext context , Object rootObject , Class < T > desiredResultType )
throws EvaluationException {
Object value = getValue ( context , rootObject ) ;