pruned bean references support as it was not used

This commit is contained in:
Keith Donald
2009-03-23 21:33:15 +00:00
parent c546ca68d8
commit be61846331
4 changed files with 0 additions and 119 deletions

View File

@@ -51,16 +51,6 @@ public interface EvaluationContext {
*/
Object lookupVariable(String name);
// TODO lookupReference() - is it too expensive to return all objects within a context?
/**
* Look up an object reference in a particular context. If no contextName is specified (null), assume the default
* context. If no objectName is specified (null), return all objects in the specified context (List).
* @param contextName the context in which to perform the lookup (or <code>null</code> for default context)
* @param objectName the object to lookup in the context (or <code>null</code> to get all objects)
* @return a specific object or List
*/
Object lookupReference(Object contextName, String objectName) throws EvaluationException;
/**
* @return a list of resolvers that will be asked in turn to locate a constructor
*/

View File

@@ -91,10 +91,6 @@ public class ExpressionState {
return this.relatedContext.lookupVariable(name);
}
public Object lookupReference(Object contextName, String objectName) throws EvaluationException {
return this.relatedContext.lookupReference(contextName, objectName);
}
public TypeComparator getTypeComparator() {
return this.relatedContext.getTypeComparator();
}

View File

@@ -47,8 +47,6 @@ public class StandardEvaluationContext implements EvaluationContext {
private final Map<String, Object> variables = new HashMap<String, Object>();
private final Map<String, Map<String, Object>> simpleReferencesMap = new HashMap<String, Map<String, Object>>();
private final List<ConstructorResolver> constructorResolvers = new ArrayList<ConstructorResolver>();
private final List<MethodResolver> methodResolvers = new ArrayList<MethodResolver>();
@@ -63,14 +61,12 @@ public class StandardEvaluationContext implements EvaluationContext {
private OperatorOverloader operatorOverloader = new StandardOperatorOverloader();
public StandardEvaluationContext() {
this.methodResolvers.add(new ReflectiveMethodResolver());
this.constructorResolvers.add(new ReflectiveConstructorResolver());
this.propertyAccessors.add(new ReflectivePropertyResolver());
}
public void setRootObject(Object rootObject) {
this.rootObject = rootObject;
}
@@ -91,28 +87,6 @@ public class StandardEvaluationContext implements EvaluationContext {
return this.variables.get(name);
}
public void addReference(String contextName, String objectName, Object value) {
Map<String, Object> contextMap = this.simpleReferencesMap.get(contextName);
if (contextMap == null) {
contextMap = new HashMap<String, Object>();
this.simpleReferencesMap.put(contextName, contextMap);
}
contextMap.put(objectName, value);
}
public Object lookupReference(Object contextName, String objectName) {
String contextToLookup = (contextName == null ? "root" : (String) contextName);
// if (contextName==null) return simpleReferencesMap;
Map<String, Object> contextMap = this.simpleReferencesMap.get(contextToLookup);
if (contextMap == null) {
return null;
}
if (objectName == null) {
return contextMap;
}
return contextMap.get(objectName);
}
public void addConstructorResolver(ConstructorResolver resolver) {
this.constructorResolvers.add(this.constructorResolvers.size() - 1, resolver);
}