SPR-6763: more methods on StandardEvaluationContext supporting add/remove from resolver/accessor strategies

This commit is contained in:
Andy Clement
2010-02-02 21:38:33 +00:00
parent 66f708392e
commit 5ca1f11ce2
4 changed files with 125 additions and 0 deletions

View File

@@ -97,11 +97,20 @@ public class StandardEvaluationContext implements EvaluationContext {
ensureConstructorResolversInitialized();
this.constructorResolvers.add(this.constructorResolvers.size() - 1, resolver);
}
public boolean removeConstructorResolver(ConstructorResolver resolver) {
ensureConstructorResolversInitialized();
return this.constructorResolvers.remove(resolver);
}
public List<ConstructorResolver> getConstructorResolvers() {
ensureConstructorResolversInitialized();
return this.constructorResolvers;
}
public void setConstructorResolvers(List<ConstructorResolver> constructorResolvers) {
this.constructorResolvers = constructorResolvers;
}
private void ensureConstructorResolversInitialized() {
if (this.constructorResolvers == null) {
@@ -114,11 +123,20 @@ public class StandardEvaluationContext implements EvaluationContext {
ensureMethodResolversInitialized();
this.methodResolvers.add(this.methodResolvers.size() - 1, resolver);
}
public boolean removeMethodResolver(MethodResolver methodResolver) {
ensureMethodResolversInitialized();
return this.methodResolvers.remove(methodResolver);
}
public List<MethodResolver> getMethodResolvers() {
ensureMethodResolversInitialized();
return this.methodResolvers;
}
public void setMethodResolvers(List<MethodResolver> methodResolvers) {
this.methodResolvers = methodResolvers;
}
private void ensureMethodResolversInitialized() {
if (this.methodResolvers == null) {
@@ -131,11 +149,19 @@ public class StandardEvaluationContext implements EvaluationContext {
ensurePropertyAccessorsInitialized();
this.propertyAccessors.add(this.propertyAccessors.size() - 1, accessor);
}
public boolean removePropertyAccessor(PropertyAccessor accessor) {
return this.propertyAccessors.remove(accessor);
}
public List<PropertyAccessor> getPropertyAccessors() {
ensurePropertyAccessorsInitialized();
return this.propertyAccessors;
}
public void setPropertyAccessors(List<PropertyAccessor> propertyAccessors) {
this.propertyAccessors = propertyAccessors;
}
private void ensurePropertyAccessorsInitialized() {
if (this.propertyAccessors == null) {