Class LookupOverride
java.lang.Object
org.springframework.beans.factory.support.MethodOverride
org.springframework.beans.factory.support.LookupOverride
- All Implemented Interfaces:
- BeanMetadataElement
Represents an override of a method that looks up an object in the same IoC context,
 either by bean name or by bean type (based on the declared method return type).
 
Methods eligible for lookup override may declare arguments in which case the given arguments are passed to the bean retrieval operation.
- Since:
- 1.1
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionLookupOverride(Method method, String beanName) Construct a new LookupOverride.LookupOverride(String methodName, String beanName) Construct a new LookupOverride.
- 
Method SummaryMethods inherited from class org.springframework.beans.factory.support.MethodOverridegetMethodName, getSource, isOverloaded, setOverloaded, setSource
- 
Constructor Details- 
LookupOverrideConstruct a new LookupOverride.- Parameters:
- methodName- the name of the method to override
- beanName- the name of the bean in the current- BeanFactorythat the overridden method should return (may be- nullfor type-based bean retrieval)
 
- 
LookupOverrideConstruct a new LookupOverride.- Parameters:
- method- the method declaration to override
- beanName- the name of the bean in the current- BeanFactorythat the overridden method should return (may be- nullfor type-based bean retrieval)
 
 
- 
- 
Method Details- 
getBeanNameReturn the name of the bean that should be returned by this method.
- 
matchesMatch the specified method byMethodreference or method name.For backwards compatibility reasons, in a scenario with overloaded non-abstract methods of the given name, only the no-arg variant of a method will be turned into a container-driven lookup method. In case of a provided Method, only straight matches will be considered, usually demarcated by the@Lookupannotation.- Specified by:
- matchesin class- MethodOverride
- Parameters:
- method- the method to check
- Returns:
- whether this override matches the given method
 
- 
equals- Overrides:
- equalsin class- MethodOverride
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- MethodOverride
 
- 
toString
 
-