Class MixinInstanceMetaMethod

java.lang.Object
org.codehaus.groovy.reflection.ParameterTypes
groovy.lang.MetaMethod
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod
All Implemented Interfaces:
MetaMember, Cloneable

public class MixinInstanceMetaMethod extends MetaMethod
MetaMethod for mixed in classes. This method delegates to the underlying method on the mixin instance.
  • Constructor Details

    • MixinInstanceMetaMethod

      public MixinInstanceMetaMethod(MetaMethod method, MixinInMetaClass mixinInMetaClass)
      Constructs a new MixinInstanceMetaMethod.
      Parameters:
      method - the underlying metamethod from the mixin
      mixinInMetaClass - the mixin metadata
  • Method Details

    • getModifiers

      public int getModifiers()
      Returns the modifiers of the underlying 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 underlying 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 underlying metamethod.
      Specified by:
      getReturnType in class MetaMethod
      Returns:
      the return type
    • getDeclaringClass

      public CachedClass getDeclaringClass()
      Returns the class that declares this mixin method.
      Specified by:
      getDeclaringClass in class MetaMethod
      Returns:
      the declaring class (from the mixin)
    • invoke

      public Object invoke(Object object, Object[] arguments)
      Invokes the underlying method on the mixin instance associated with the given object.
      Specified by:
      invoke in class MetaMethod
      Parameters:
      object - the object to invoke the method on
      arguments - the method arguments
      Returns:
      the method return value
    • getPT

      protected Class[] getPT()
      Description copied from class: ParameterTypes
      Protected method subclasses override to provide parameter types. Default implementation throws UnsupportedOperationException.
      Overrides:
      getPT in class ParameterTypes
      Returns:
      the native parameter class array