Package org.codehaus.groovy.runtime.metaclass

# Class MixedInMetaClass

java.lang.Object
groovy.lang.DelegatingMetaClass
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass
org.codehaus.groovy.runtime.metaclass.MixedInMetaClass

All Implemented Interfaces:
  `GroovyObject`, `MetaClass`, `MetaObjectProtocol`, `MutableMetaClass`

public class MixedInMetaClass extends OwnedMetaClass
A delegating MetaClass that allows mixing in a mixin object. This class delegates method invocation to an owner object's MetaClass while maintaining a weak reference to the owner to prevent memory leaks.

This implementation is for internal use by the Groovy runtime's mixin feature.

- ## Field Summary

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

  `delegate`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MixedInMetaClass(Object instance, Object owner)`
  Constructs a new MixedInMetaClass.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Object`
  `getOwner()`
  Returns the owner object whose MetaClass should be used for delegated operations.
  `protected MetaClass`
  `getOwnerMetaClass(Object owner)`
  Returns the MetaClass of the owner object.
  `Object`
  `invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)`
  Invokes a method on the owner's MetaClass with caller context.

  ### Methods inherited from class org.codehaus.groovy.runtime.metaclass.OwnedMetaClass

  `equals, getAttribute, getAttribute, getClassNode, getMetaMethod, getMetaMethod, getMetaMethods, getMetaProperty, getMethods, getProperties, getProperty, getProperty, getStaticMetaMethod, getStaticMetaMethod, getTheClass, hashCode, hasProperty, invokeConstructor, invokeMethod, invokeMethod, invokeMissingMethod, invokeMissingProperty, invokeStaticMethod, isGroovyObject, respondsTo, respondsTo, selectConstructorAndTransformArguments, setAttribute, setAttribute, setProperty, setProperty, toString`

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

  `addMetaBeanProperty, addMetaMethod, addNewInstanceMethod, addNewStaticMethod, getAdaptee, getMetaClass, getProperty, initialize, invokeMethod, isModified, pickMethod, setAdaptee, setMetaClass, setProperty`

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

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

- ## Constructor Details

  - ### MixedInMetaClass

    public MixedInMetaClass(Object instance, Object owner)
    Constructs a new MixedInMetaClass.
    Parameters:
      `instance` - the instance that will have the mixin applied
      `owner` - the owner object that provides the mixin functionality

- ## Method Details

  - ### getOwner

    protected Object getOwner()
    Description copied from class: `OwnedMetaClass`
    Returns the owner object whose MetaClass should be used for delegated operations.
    Specified by:
      `getOwner` in class `OwnedMetaClass`
    Returns:
      the owner object

  - ### getOwnerMetaClass

    protected MetaClass getOwnerMetaClass(Object owner)
    Description copied from class: `OwnedMetaClass`
    Returns the MetaClass of the owner object.
    Specified by:
      `getOwnerMetaClass` in class `OwnedMetaClass`
    Parameters:
      `owner` - the owner object
    Returns:
      the owner's MetaClass

  - ### invokeMethod

    public Object invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)
    Description copied from class: `OwnedMetaClass`
    Invokes a method on the owner's MetaClass with caller context.
    Specified by:
      `invokeMethod` in interface `MetaClass`
    Overrides:
      `invokeMethod` in class `OwnedMetaClass`
    Parameters:
      `sender` - the class making the request
      `receiver` - the receiver object (ignored; the owner is used instead)
      `methodName` - the method name
      `arguments` - the method arguments
      `isCallToSuper` - whether this is a super method call
      `fromInsideClass` - whether this is called from inside the class
    Returns:
      the method result