public abstract class

MethodOverride

extends Object
implements BeanMetadataElement
java.lang.Object
   ↳ org.springframework.beans.factory.support.MethodOverride
Known Direct Subclasses

Class Overview

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.

Summary

Protected Constructors
MethodOverride(String methodName)
Construct a new override for the given method.
Public Methods
boolean equals(Object other)
String getMethodName()
Return the name of the method to be overridden.
Object getSource()
Return the configuration source Object for this metadata element (may be null).
int hashCode()
abstract boolean matches(Method method)
Subclasses must override this to indicate whether they match the given method.
void setSource(Object source)
Set the configuration source Object for this metadata element.
Protected Methods
boolean isOverloaded()
Return whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
void setOverloaded(boolean overloaded)
Set whether the overridden method has to be considered as overloaded (that is, whether arg type matching has to happen).
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.BeanMetadataElement

Protected Constructors

protected MethodOverride (String methodName)

Also: SpringBeans

Construct a new override for the given method.

Parameters
methodName the name of the method to override

Public Methods

public boolean equals (Object other)

public String getMethodName ()

Also: SpringBeans

Return the name of the method to be overridden.

public Object getSource ()

Also: SpringBeans

Return the configuration source Object for this metadata element (may be null).

public int hashCode ()

public abstract boolean matches (Method method)

Also: SpringBeans

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

public void setSource (Object source)

Also: SpringBeans

Set the configuration source Object for this metadata element.

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

Protected Methods

protected boolean isOverloaded ()

Also: SpringBeans

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

protected void setOverloaded (boolean overloaded)

Also: SpringBeans

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.