类 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

        public LookupOverride​(String methodName,
                              String beanName)
        Construct a new LookupOverride.
        参数:
        methodName - the name of the method to override
        beanName - the name of the bean in the current BeanFactory that the overridden method should return (may be null)
      • LookupOverride

        public LookupOverride​(Method method,
                              String beanName)
        Construct a new LookupOverride.
        参数:
        method - the method to override
        beanName - the name of the bean in the current BeanFactory that the overridden method should return (may be null)
    • 方法详细资料

      • getBeanName

        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 by 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 在类中 MethodOverride
        参数:
        method - the method to check
        返回:
        whether this override matches the given method