org.springframework.beans.factory.support

## Class LookupOverride

- java.lang.Object
- - org.springframework.beans.factory.support.MethodOverride
  - - org.springframework.beans.factory.support.LookupOverride

- All Implemented Interfaces:
    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.

  Since:
    1.1
  Author:
    Rod Johnson, Juergen Hoeller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LookupOverride(String methodName, String beanName)` Construct a new LookupOverride.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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 method of the given name, with no parameters.
    `String` | `toString()`

    - ### Methods inherited from class org.springframework.beans.factory.support.MethodOverride

      `getMethodName, getSource, isOverloaded, setOverloaded, setSource`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LookupOverride

          public LookupOverride(String methodName,
                                String beanName)

      Construct a new LookupOverride.
      Parameters:
        `methodName` - the name of the method to override. This method must have no arguments.
        `beanName` - the name of the bean in the current BeanFactory that the overridden 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)

      Match the method of the given name, with no parameters.
      Specified by:
        `matches` in class `MethodOverride`
      Parameters:
        `method` - the method to check
      Returns:
        whether this override matches the given method

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `MethodOverride`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `MethodOverride`