groovy.lang

## Class MetaMethod

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

All Implemented Interfaces:
  Cloneable

Direct Known Subclasses:
  CachedMethod, CallSiteAwareMetaMethod, ClosureMetaMethod, ClosureStaticMetaMethod, GeneratedMetaMethod, MixinInstanceMetaMethod, ReflectionMetaMethod, TransformMetaMethod

    public abstract class MetaMethod
    extends ParameterTypes
    implements Cloneable

Represents a Method on a Java object a little like `Method` except without using reflection to invoke the method

Version:
  $Revision: 18226 $
Author:
  James Strachan, Alex Tkachman

### Field Summary

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

`isVargsMethod, nativeParamTypes, parameterTypes`

### Constructor Summary

Constructors
Constructor and Description
`MetaMethod()`
`MetaMethod(Class[] pt)`

### Method Summary

Methods
`void` `checkParameters(Class[] arguments)` Checks that the given parameters are valid to call this method
`Object` `clone()`
`Object` `doMethodInvoke(Object object, Object[] argumentArray)`
`protected static boolean` `equal(CachedClass[] a, CachedClass[] b)`
`protected static boolean` `equal(CachedClass[] a, Class[] b)`
`abstract CachedClass` `getDeclaringClass()`
`String` `getDescriptor()`
`abstract int` `getModifiers()`
`String` `getMopName()`
`abstract String` `getName()`
`abstract Class` `getReturnType()`
`String` `getSignature()`
`abstract Object` `invoke(Object object, Object[] arguments)`
`boolean` `isAbstract()`
`boolean` `isCacheable()`
`boolean` `isMethod(MetaMethod method)`
`boolean` `isPrivate()`
`boolean` `isProtected()`
`boolean` `isPublic()`
`boolean` `isSame(MetaMethod method)`
`boolean` `isStatic()`
`RuntimeException` `processDoMethodInvokeException(Exception e, Object object, Object[] argumentArray)`
`String` `toString()`

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

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

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

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### MetaMethod

    public MetaMethod()

#### MetaMethod

    public MetaMethod(Class[] pt)

### Method Detail

#### getModifiers

    public abstract int getModifiers()

#### getName

    public abstract String getName()

#### getReturnType

    public abstract Class getReturnType()

#### getDeclaringClass

    public abstract CachedClass getDeclaringClass()

#### invoke

    public abstract Object invoke(Object object,
                Object[] arguments)

#### checkParameters

    public void checkParameters(Class[] arguments)

Checks that the given parameters are valid to call this method

Parameters:
  `arguments` - the arguments to check
Throws:
  `IllegalArgumentException` - if the parameters are not valid

#### isMethod

    public boolean isMethod(MetaMethod method)

#### equal

    protected static boolean equal(CachedClass[] a,
                Class[] b)

#### equal

    protected static boolean equal(CachedClass[] a,
                CachedClass[] b)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### clone

    public Object clone()

Overrides:
  `clone` in class `Object`

#### isStatic

    public boolean isStatic()

#### isAbstract

    public boolean isAbstract()

#### isPrivate

    public final boolean isPrivate()

#### isProtected

    public final boolean isProtected()

#### isPublic

    public final boolean isPublic()

#### isSame

    public final boolean isSame(MetaMethod method)

Parameters:
  `method` - the method to compare against
Returns:
  true if the given method has the same name, parameters, return type and modifiers but may be defined on another type

#### isCacheable

    public boolean isCacheable()

#### getDescriptor

    public String getDescriptor()

#### getSignature

    public String getSignature()

#### getMopName

    public String getMopName()

#### processDoMethodInvokeException

    public final RuntimeException processDoMethodInvokeException(Exception e,
                                                  Object object,
                                                  Object[] argumentArray)

#### doMethodInvoke

    public Object doMethodInvoke(Object object,
                        Object[] argumentArray)