Spring Framework

org.springframework.beans.factory.support
Class MethodOverride

java.lang.Object
  extended by org.springframework.beans.factory.support.MethodOverride
All Implemented Interfaces:
BeanMetadataElement
Direct Known Subclasses:
LookupOverride, ReplaceOverride

public abstract class MethodOverride
extends java.lang.Object
implements BeanMetadataElement

Object representing the override of a method on a managed object by the IoC container.

Note that the override mechanism is not intended as a generic means of inserting crosscutting code: use AOP for that.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
protected MethodOverride(java.lang.String methodName)
          Construct a new override for the given method.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getMethodName()
          Return the name of the method to be overridden.
 java.lang.Object getSource()
          Return the configuration source Object for this metadata element (may be null).
 int hashCode()
           
protected  boolean isOverloaded()
          Return whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
abstract  boolean matches(java.lang.reflect.Method method)
          Subclasses must override this to indicate whether they match the given method.
protected  void setOverloaded(boolean overloaded)
          Set whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
 void setSource(java.lang.Object source)
          Set the configuration source Object for this metadata element.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodOverride

protected MethodOverride(java.lang.String methodName)
Construct a new override for the given method.

Parameters:
methodName - the name of the method to override
Method Detail

getMethodName

public java.lang.String getMethodName()
Return the name of the method to be overridden.


setOverloaded

protected void setOverloaded(boolean overloaded)
Set whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).

Default is "true"; can be switched to "false" to optimize runtime performance.


isOverloaded

protected boolean isOverloaded()
Return whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).


setSource

public void setSource(java.lang.Object source)
Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.


getSource

public java.lang.Object getSource()
Description copied from interface: BeanMetadataElement
Return the configuration source Object for this metadata element (may be null).

Specified by:
getSource in interface BeanMetadataElement

matches

public abstract boolean matches(java.lang.reflect.Method method)
Subclasses must override this to indicate whether they match the given method. This allows for argument list checking as well as method name checking.

Parameters:
method - the method to check
Returns:
whether this override matches the given method

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Spring Framework