类 LookupOverride
- java.lang.Object
- org.springframework.beans.factory.support.MethodOverride
- org.springframework.beans.factory.support.LookupOverride
- 所有已实现的接口:
BeanMetadataElement
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.
- 从以下版本开始:
- 1.1
- 作者:
- Rod Johnson, Juergen Hoeller
构造器概要
构造器 构造器 说明 LookupOverride(Method method, String beanName)Construct a new LookupOverride.LookupOverride(String methodName, String beanName)Construct a new LookupOverride.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(Object other)StringgetBeanName()Return the name of the bean that should be returned by this method.inthashCode()booleanmatches(Method method)Match the specified method byMethodreference or method name.StringtoString()从类继承的方法 org.springframework.beans.factory.support.MethodOverride
getMethodName, getSource, isOverloaded, setOverloaded, setSource
构造器详细资料
LookupOverride
public LookupOverride(String methodName, @Nullable String beanName)
Construct a new LookupOverride.- 参数:
methodName- the name of the method to overridebeanName- the name of the bean in the currentBeanFactorythat the overridden method should return (may benull)
LookupOverride
public LookupOverride(Method method, @Nullable String beanName)
Construct a new LookupOverride.- 参数:
method- the method to overridebeanName- the name of the bean in the currentBeanFactorythat the overridden method should return (may benull)
方法详细资料
getBeanName
@Nullable public String getBeanName()
Return the name of the bean that should be returned by this method.
matches
public boolean matches(Method method)
Match 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.- 指定者:
matches在类中MethodOverride- 参数:
method- the method to check- 返回:
- whether this override matches the given method
equals
public boolean equals(@Nullable Object other)
- 覆盖:
equals在类中MethodOverride
hashCode
public int hashCode()
- 覆盖:
hashCode在类中MethodOverride