org.springframework.beans.factory.support
Class ReplaceOverride

java.lang.Object
  extended by org.springframework.beans.factory.support.MethodOverride
      extended by org.springframework.beans.factory.support.ReplaceOverride
All Implemented Interfaces:
BeanMetadataElement

public class ReplaceOverride
extends MethodOverride

Extension of MethodOverride that represents an arbitrary override of a method by the IoC container.

Any non-final method can be overridden, irrespective of its parameters and return types.

Since:
1.1
Author:
Rod Johnson, Juergen Hoeller

Field Summary
private  java.lang.String methodReplacerBeanName
           
private  java.util.List<java.lang.String> typeIdentifiers
           
 
Constructor Summary
ReplaceOverride(java.lang.String methodName, java.lang.String methodReplacerBeanName)
          Construct a new ReplaceOverride.
 
Method Summary
 void addTypeIdentifier(java.lang.String identifier)
          Add a fragment of a class string, like "Exception" or "java.lang.Exc", to identify a parameter type.
 boolean equals(java.lang.Object other)
           
 java.lang.String getMethodReplacerBeanName()
          Return the name of the bean implementing MethodReplacer.
 int hashCode()
           
 boolean matches(java.lang.reflect.Method method)
          Subclasses must override this to indicate whether they match the given method.
 java.lang.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
 

Field Detail

methodReplacerBeanName

private final java.lang.String methodReplacerBeanName

typeIdentifiers

private java.util.List<java.lang.String> typeIdentifiers
Constructor Detail

ReplaceOverride

public ReplaceOverride(java.lang.String methodName,
                       java.lang.String methodReplacerBeanName)
Construct a new ReplaceOverride.

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

getMethodReplacerBeanName

public java.lang.String getMethodReplacerBeanName()
Return the name of the bean implementing MethodReplacer.


addTypeIdentifier

public void addTypeIdentifier(java.lang.String identifier)
Add a fragment of a class string, like "Exception" or "java.lang.Exc", to identify a parameter type.

Parameters:
identifier - a substring of the fully qualified class name

matches

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

Specified by:
matches in class MethodOverride
Parameters:
method - the method to check
Returns:
whether this override matches the given method

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class MethodOverride