Package org.codehaus.groovy.reflection

# Class CachedMethod

java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.reflection.CachedMethod

All Implemented Interfaces:
  `MetaMember`, `Cloneable`, `Comparable`

public class CachedMethod extends MetaMethod implements Comparable

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final CachedClass`
  `cachedClass`
  `static final CachedMethod[]`
  `EMPTY_ARRAY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CachedMethod(Method method)`
  `CachedMethod(CachedClass clazz, Method method)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `canAccessLegally(Class<?> callerClass)`
  `int`
  `compareTo(Object other)`
  `CallSite`
  `createPogoMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)`
  `CallSite`
  `createPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)`
  `CallSite`
  `createStaticMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)`
  `boolean`
  `equals(Object other)`
  `static CachedMethod`
  `find(Method method)`
  `<T extends Annotation>
  T`
  `getAnnotation(Class<T> annotationClass)`
  `Method`
  `getCachedMethod()`
  `CachedClass`
  `getDeclaringClass()`
  Gets the class where this method is declared.
  `String`
  `getDescriptor()`
  Returns a descriptor of this method based on the return type and parameters of this method.
  `int`
  `getModifiers()`
  Returns the modifiers of this method.
  `String`
  `getName()`
  Returns the name of this method.
  `int`
  `getParamsCount()`
  `ParameterTypes`
  `getParamTypes()`
  `Class[]`
  `getPT()`
  `Class`
  `getReturnType()`
  Returns the return type for this method.
  `String`
  `getSignature()`
  Returns the signature of this method.
  `CachedMethod`
  `getTransformedMethod()`
  `int`
  `hashCode()`
  `final Object`
  `invoke(Object object, Object[] arguments)`
  Invokes this method.
  `boolean`
  `isSynthetic()`
  `final Method`
  `setAccessible()`
  `void`
  `setTransformedMethod(CachedMethod transformedMethod)`
  `String`
  `toString()`

  ### Methods inherited from class groovy.lang.MetaMethod

  `checkParameters, clone, doMethodInvoke, equal, equal, getMopName, isAbstract, isCacheable, isDefault, isMethod, isSame, processDoMethodInvokeException`

  ### Methods inherited from class org.codehaus.groovy.reflection.ParameterTypes

  `coerceArgumentsToClasses, correctArguments, getNativeParameterTypes, getParameterTypes, isValidExactMethod, isValidExactMethod, isValidMethod, isValidMethod, isVargsMethod, isVargsMethod, setParametersTypes`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface groovy.lang.MetaMember

  `isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic`

- ## Field Details

  - ### EMPTY_ARRAY

    public static final CachedMethod[] EMPTY_ARRAY

  - ### cachedClass

    public final CachedClass cachedClass

- ## Constructor Details

  - ### CachedMethod

    public CachedMethod(CachedClass clazz, Method method)

  - ### CachedMethod

    public CachedMethod(Method method)

- ## Method Details

  - ### find

    public static CachedMethod find(Method method)

  - ### compareTo

    public int compareTo(Object other)
    Specified by:
      `compareTo` in interface `Comparable`

  - ### equals

    public boolean equals(Object other)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `MetaMethod`

  - ### canAccessLegally

    public boolean canAccessLegally(Class<?> callerClass)

  - ### getAnnotation

    public <T extends Annotation> T getAnnotation(Class<T> annotationClass)

  - ### getCachedMethod

    public Method getCachedMethod()

  - ### getDeclaringClass

    public CachedClass getDeclaringClass()
    Description copied from class: `MetaMethod`
    Gets the class where this method is declared.
    Specified by:
      `getDeclaringClass` in class `MetaMethod`
    Returns:
      class of this method

  - ### getDescriptor

    public String getDescriptor()
    Description copied from class: `MetaMethod`
    Returns a descriptor of this method based on the return type and parameters of this method.
    Overrides:
      `getDescriptor` in class `MetaMethod`

  - ### getModifiers

    public int getModifiers()
    Description copied from class: `MetaMethod`
    Returns the modifiers of this method.
    Specified by:
      `getModifiers` in interface `MetaMember`
    Specified by:
      `getModifiers` in class `MetaMethod`
    Returns:
      modifiers as an int.

  - ### getName

    public String getName()
    Description copied from class: `MetaMethod`
    Returns the name of this method.
    Specified by:
      `getName` in interface `MetaMember`
    Specified by:
      `getName` in class `MetaMethod`
    Returns:
      name of this method

  - ### getParamsCount

    public int getParamsCount()

  - ### getParamTypes

    public ParameterTypes getParamTypes()

  - ### getPT

    public Class[] getPT()
    Overrides:
      `getPT` in class `ParameterTypes`

  - ### getReturnType

    public Class getReturnType()
    Description copied from class: `MetaMethod`
    Returns the return type for this method.
    Specified by:
      `getReturnType` in class `MetaMethod`
    Returns:
      the return type of this method

  - ### getSignature

    public String getSignature()
    Description copied from class: `MetaMethod`
    Returns the signature of this method.
    Overrides:
      `getSignature` in class `MetaMethod`
    Returns:
      The signature of this method

  - ### isSynthetic

    public boolean isSynthetic()
    Specified by:
      `isSynthetic` in interface `MetaMember`

  - ### getTransformedMethod

    public CachedMethod getTransformedMethod()

  - ### setTransformedMethod

    public void setTransformedMethod(CachedMethod transformedMethod)

  - ### createPogoMetaMethodSite

    public CallSite createPogoMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)

  - ### createPojoMetaMethodSite

    public CallSite createPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)

  - ### createStaticMetaMethodSite

    public CallSite createStaticMetaMethodSite(CallSite site, MetaClassImpl metaClass, Class[] params)

  - ### invoke

    public final Object invoke(Object object, Object[] arguments)
    Description copied from class: `MetaMethod`
    Invokes this method.
    Specified by:
      `invoke` in class `MetaMethod`
    Parameters:
      `object` - The object this method should be invoked on
      `arguments` - The arguments for the method if applicable
    Returns:
      The return value of the invocation

  - ### setAccessible

    public final Method setAccessible()