org.springframework.beans.factory.support
Class LookupOverride

java.lang.Object
  extended byorg.springframework.beans.factory.support.MethodOverride
      extended byorg.springframework.beans.factory.support.LookupOverride

public class LookupOverride
extends MethodOverride

Represents an override of a method that looks up an object in the same IoC context.

Methods eligible for lookup override must not have arguments.

Author:
Rod Johnson

Constructor Summary
LookupOverride(String methodName, String beanName)
          Construct a new LookupOverride.
 
Method Summary
 String getBeanName()
          Return the name of the bean that should be returned by this method.
 boolean matches(Method method, MethodOverrides overrides)
          Doesn't allow for overloading, so matching method name is fine.
 String toString()
           
 
Methods inherited from class org.springframework.beans.factory.support.MethodOverride
getMethodName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LookupOverride

public LookupOverride(String methodName,
                      String beanName)
Construct a new LookupOverride.

Parameters:
methodName - name of the method to override. This method must have no arguments.
beanName - name of the bean in the current BeanFactory or ApplicationContext that the overriden method should return
Method Detail

getBeanName

public String getBeanName()
Return the name of the bean that should be returned by this method.


matches

public boolean matches(Method method,
                       MethodOverrides overrides)
Doesn't allow for overloading, so matching method name is fine.

Specified by:
matches in class MethodOverride
Parameters:
method - the method to check
overrides - owning MethodOverrides object. This allows us to check whether the method is overloaded.
Returns:
whether this override matches the given method

toString

public String toString()


Copyright (C) 2003-2004 The Spring Framework Project.