Class MethodKey

java.lang.Object
org.springframework.binding.method.MethodKey
All Implemented Interfaces:
Serializable

public class MethodKey extends Object implements Serializable
A helper for resolving and caching a Java method by reflection.
Author:
Keith Donald
See Also:
  • Constructor Details

    • MethodKey

      public MethodKey(Class<?> declaredType, String methodName, Class<?>... parameterTypes)
      Create a new method key.
      Parameters:
      declaredType - the class the method is a member of
      methodName - the method name
      parameterTypes - the method's parameter types, or null if the method has no parameters
  • Method Details

    • getDeclaredType

      public Class<?> getDeclaredType()
      Return the class the method is a member of.
    • getMethodName

      public String getMethodName()
      Returns the method name.
    • getParameterTypes

      public Class<?>[] getParameterTypes()
      Returns the method parameter types. Could contain null values if no type was specified for the corresponding parameter.
    • getMethod

      public Method getMethod() throws InvalidMethodKeyException
      Returns the keyed method, resolving it if necessary via reflection.
      Throws:
      InvalidMethodKeyException
    • resolveMethod

      protected Method resolveMethod() throws InvalidMethodKeyException
      Resolve the keyed method.
      Throws:
      InvalidMethodKeyException
    • findMethodConsiderAssignableParameterTypes

      protected Method findMethodConsiderAssignableParameterTypes()
      Find the keyed method using 'relaxed' typing.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object