This commit is contained in:
Keith Donald
2008-07-03 22:42:53 +00:00
parent d6608b8cc9
commit 04449bcb0b
3 changed files with 7 additions and 9 deletions

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.binding.expression.el;
import java.io.Serializable;
import javax.el.ELContext;
import javax.el.ELResolver;
@@ -30,7 +28,7 @@ import javax.el.ELResolver;
* @author Keith Donald
* @author Jeremy Grelle
*/
public interface ELContextFactory extends Serializable {
public interface ELContextFactory {
/**
* Configures and returns an {@link ELContext} to be used in evaluating EL expressions on the given base target

View File

@@ -51,8 +51,8 @@ public class ELExpression implements Expression {
public ELExpression(ELContextFactory factory, ValueExpression valueExpression, ConversionService conversionService,
boolean template) {
Assert.notNull(factory, "The ELContextFactory is required to evaluate EL expressions");
Assert.notNull(valueExpression, "The EL value expression is required for evaluation");
Assert.notNull(conversionService, "The conversion service is required");
Assert.notNull(valueExpression, "The EL ValueExpression is required for evaluation");
Assert.notNull(conversionService, "The ConversionService to perform type coersions is required");
this.elContextFactory = factory;
this.valueExpression = valueExpression;
this.conversionService = conversionService;
@@ -151,7 +151,6 @@ public class ELExpression implements Expression {
}
public String toString() {
return valueExpression.getExpressionString();
return getExpressionString();
}
}

View File

@@ -84,6 +84,7 @@ class OgnlExpression implements Expression {
public void setValue(Object context, Object value) {
try {
Map evaluationContext = Ognl.addDefaultContext(context, getVariables(context));
// TODO set TypeConverter here to invoke our ConversionService
Ognl.setValue(expression, evaluationContext, context, value);
} catch (NoSuchPropertyException e) {
throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
@@ -97,7 +98,7 @@ class OgnlExpression implements Expression {
public Class getValueType(Object context) {
try {
// OGNL has no native way to get this information
return new BeanWrapperImpl(context).getPropertyDescriptor(expressionString).getPropertyType();
return new BeanWrapperImpl(context).getPropertyType(expressionString);
} catch (InvalidPropertyException e) {
throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e);
} catch (BeansException e) {
@@ -125,6 +126,6 @@ class OgnlExpression implements Expression {
}
public String toString() {
return expression.toString();
return expressionString;
}
}