Class MethodOverride
java.lang.Object
org.springframework.beans.factory.support.MethodOverride
- All Implemented Interfaces:
- BeanMetadataElement
- Direct Known Subclasses:
- LookupOverride,- ReplaceOverride
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, Sam Brannen
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedMethodOverride(String methodName) Construct a new override for the given method.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturn the name of the method to be overridden.Return the configuration sourceObjectfor this metadata element (may benull).inthashCode()protected booleanReturn whether the overridden method is overloaded (i.e., whether argument type matching needs to occur to disambiguate methods of the same name).abstract booleanSubclasses must override this to indicate whether they match the given method.protected voidsetOverloaded(boolean overloaded) Set whether the overridden method is overloaded (i.e., whether argument type matching needs to occur to disambiguate methods of the same name).voidSet the configuration sourceObjectfor this metadata element.
- 
Constructor Details- 
MethodOverrideConstruct a new override for the given method.- Parameters:
- methodName- the name of the method to override
 
 
- 
- 
Method Details- 
getMethodNameReturn the name of the method to be overridden.
- 
setOverloadedprotected void setOverloaded(boolean overloaded) Set whether the overridden method is overloaded (i.e., whether argument type matching needs to occur to disambiguate methods of the same name).Default is true; can be switched tofalseto optimize runtime performance.
- 
isOverloadedprotected boolean isOverloaded()Return whether the overridden method is overloaded (i.e., whether argument type matching needs to occur to disambiguate methods of the same name).
- 
setSourceSet the configuration sourceObjectfor this metadata element.The exact type of the object will depend on the configuration mechanism used. 
- 
getSourceDescription copied from interface:BeanMetadataElementReturn the configuration sourceObjectfor this metadata element (may benull).- Specified by:
- getSourcein interface- BeanMetadataElement
 
- 
matchesSubclasses 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
- 
hashCodepublic int hashCode()
 
-