Package org.codehaus.groovy.runtime.metaclass

# Class TransformMetaMethod

java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.runtime.metaclass.TransformMetaMethod

All Implemented Interfaces:
  `MetaMember`, `Cloneable`

public class TransformMetaMethod extends MetaMethod
A MetaMethod implementation useful for implementing coercion based invocations. This method wraps another metamethod and allows for argument transformation or other custom handling during method invocation.

- ## Field Summary

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

  `EMPTY_ARRAY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TransformMetaMethod(MetaMethod metaMethod)`
  Constructs a new TransformMetaMethod.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `doMethodInvoke(Object object, Object[] arguments)`
  Invokes the wrapped metamethod without argument coercion.
  `CachedClass`
  `getDeclaringClass()`
  Returns the class that declares the wrapped metamethod.
  `int`
  `getModifiers()`
  Returns the modifiers of the wrapped metamethod.
  `String`
  `getName()`
  Returns the name of the wrapped metamethod.
  `Class`
  `getReturnType()`
  Returns the return type of the wrapped metamethod.
  `Object`
  `invoke(Object object, Object[] arguments)`
  Invokes the wrapped metamethod on the given object with the specified arguments.

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

  `checkParameters, clone, equal, equal, getDescriptor, getMopName, getSignature, isAbstract, isCacheable, isDefault, isMethod, isSame, processDoMethodInvokeException, toString`

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

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

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

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

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

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

- ## Constructor Details

  - ### TransformMetaMethod

    public TransformMetaMethod(MetaMethod metaMethod)
    Constructs a new TransformMetaMethod.
    Parameters:
      `metaMethod` - the metamethod to wrap

- ## Method Details

  - ### getModifiers

    public int getModifiers()
    Returns the modifiers of the wrapped metamethod.
    Specified by:
      `getModifiers` in interface `MetaMember`
    Specified by:
      `getModifiers` in class `MetaMethod`
    Returns:
      the method modifiers

  - ### getName

    public String getName()
    Returns the name of the wrapped metamethod.
    Specified by:
      `getName` in interface `MetaMember`
    Specified by:
      `getName` in class `MetaMethod`
    Returns:
      the method name

  - ### getReturnType

    public Class getReturnType()
    Returns the return type of the wrapped metamethod.
    Specified by:
      `getReturnType` in class `MetaMethod`
    Returns:
      the return type

  - ### getDeclaringClass

    public CachedClass getDeclaringClass()
    Returns the class that declares the wrapped metamethod.
    Specified by:
      `getDeclaringClass` in class `MetaMethod`
    Returns:
      the declaring class

  - ### invoke

    public Object invoke(Object object, Object[] arguments)
    Invokes the wrapped metamethod on the given object with the specified arguments.
    Specified by:
      `invoke` in class `MetaMethod`
    Parameters:
      `object` - the object to invoke the method on
      `arguments` - the method arguments
    Returns:
      the method return value

  - ### doMethodInvoke

    public Object doMethodInvoke(Object object, Object[] arguments)
    Invokes the wrapped metamethod without argument coercion. This method skips the default argument coercion performed by the parent invoke method.
    Overrides:
      `doMethodInvoke` in class `MetaMethod`
    Parameters:
      `object` - the object to invoke the method on
      `arguments` - the method arguments
    Returns:
      the method return value