public class LookupOverride extends MethodOverride
Methods eligible for lookup override may declare arguments in which case the given arguments are passed to the bean retrieval operation.
BeanFactory.getBean(String),
BeanFactory.getBean(Class),
BeanFactory.getBean(String, Object...),
BeanFactory.getBean(Class, Object...),
BeanFactory.getBeanProvider(ResolvableType)| Constructor and Description |
|---|
LookupOverride(Method method,
String beanName)
Construct a new LookupOverride.
|
LookupOverride(String methodName,
String beanName)
Construct a new LookupOverride.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
String |
getBeanName()
Return the name of the bean that should be returned by this method.
|
int |
hashCode() |
boolean |
matches(Method method)
Match the specified method by
Method reference or method name. |
String |
toString() |
getMethodName, getSource, isOverloaded, setOverloaded, setSourcepublic LookupOverride(String methodName, @Nullable String beanName)
methodName - the name of the method to overridebeanName - the name of the bean in the current BeanFactory that the
overridden method should return (may be null for type-based bean retrieval)public LookupOverride(Method method, @Nullable String beanName)
method - the method declaration to overridebeanName - the name of the bean in the current BeanFactory that the
overridden method should return (may be null for type-based bean retrieval)@Nullable public String getBeanName()
public boolean matches(Method method)
Method reference 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 @Lookup annotation.
matches in class MethodOverridemethod - the method to checkpublic boolean equals(@Nullable
Object other)
equals in class MethodOverridepublic int hashCode()
hashCode in class MethodOverride