Package: groovy.lang

## [Java] Class MetaClassImpl

- groovy.lang.MetaClassImpl

- All Implemented Interfaces and Traits:
    MetaClass, MutableMetaClass

      public class MetaClassImpl
      extends Object

  Allows methods to be dynamically added to existing classes at runtime

  Authors:
    James Strachan
    Guillaume Laforge
    Jochen "blackdrag" Theodorou
    Graeme Rocher
    Alex Tkachman
    Roshan Dawrani
  See Also:
    MetaClass

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `MetaClassImpl.Index` |
    `static class` | `MetaClassImpl.MetaConstructor` | This is a helper class introduced in Groovy 2.1.0, which is used only by indy.

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static Object[]` | `EMPTY_ARGUMENTS` |
    `protected static String` | `INVOKE_METHOD_METHOD` |
    `protected static String` | `METHOD_MISSING` |
    `protected static String` | `PROPERTY_MISSING` |
    `protected static String` | `STATIC_METHOD_MISSING` |
    `protected static String` | `STATIC_PROPERTY_MISSING` |
    `protected MetaMethod` | `getPropertyMethod` |
    `protected MetaMethod` | `invokeMethodMethod` |
    `protected boolean` | `isGroovyObject` |
    `protected boolean` | `isMap` |
    `protected MetaMethodIndex` | `metaMethodIndex` |
    `protected MetaClassRegistry` | `registry` |
    `protected MetaMethod` | `setPropertyMethod` |
    `protected CachedClass` | `theCachedClass` |
    `protected Class` | `theClass` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `MetaClassImpl (Class theClass, MetaMethod[] add)` Constructor
    `MetaClassImpl (Class theClass)` Constructor that sets the methods to null
    `MetaClassImpl (MetaClassRegistry registry, Class theClass, MetaMethod[] add)` Constructor with registry
    `MetaClassImpl (MetaClassRegistry registry, Class theClass)` Constructor with registry setting methods to null

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `addMetaBeanProperty(MetaBeanProperty mp)` Adds a new MetaBeanProperty to this MetaClass
    `void` | `addMetaMethod(MetaMethod method)` adds a MetaMethod to this class.
    `protected void` | `addMetaMethodToIndex(MetaMethod method, Header header)`
    `void` | `addNewInstanceMethod(Method method)` Adds an instance method to this metaclass.
    `void` | `addNewStaticMethod(Method method)` Adds a static method to this metaclass.
    `protected void` | `applyPropertyDescriptors(PropertyDescriptor[] propertyDescriptors)`
    `protected void` | `checkIfGroovyObjectMethod(MetaMethod metaMethod)` Checks if the metaMethod is a method from the GroovyObject interface such as setProperty, getProperty and invokeMethod
    `protected void` | `checkInitalised()` checks if the initialisation of the class id complete.
    `protected Object` | `chooseMethod(String methodName, Object methodOrList, Class[] arguments)` Chooses the correct method to use from a list of methods which match by name.
    `protected void` | `clearInvocationCaches()` remove all method call cache entries.
    `CallSite` | `createConstructorSite(CallSite site, Object[] args)` Create a CallSite
    `CallSite` | `createPogoCallCurrentSite(CallSite site, Class sender, Object[] args)` Create a CallSite
    `CallSite` | `createPogoCallSite(CallSite site, Object[] args)` Create a CallSite
    `CallSite` | `createPojoCallSite(CallSite site, Object receiver, Object[] args)` Create a CallSite
    `CallSite` | `createStaticSite(CallSite site, Object[] args)` Create a CallSite
    `protected void` | `dropMethodCache(String name)`
    `protected void` | `dropStaticMethodCache(String name)`
    `protected static MetaMethod` | `findMethodInClassHierarchy(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass)`
    `protected MetaMethod` | `findMixinMethod(String methodName, Class[] arguments)`
    `protected static MetaMethod` | `findOwnMethod(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass, MetaMethod method)`
    `protected MetaBeanProperty` | `findPropertyInClassHierarchy(String propertyName, CachedClass theClass)`
    `MetaMethod[]` | `getAdditionalMetaMethods()` Retrieves a list of additional MetaMethods held by this class
    `Object` | `getAttribute(Class sender, Object receiver, String messageName, boolean useSuper)` Retrieves the value of an attribute (field).
    `Object` | `getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass)` Retrieves the value of an attribute (field).
    `Object` | `getAttribute(Object object, String attribute)` Retrieves the value of an attribute (field).
    `ClassInfo` | `getClassInfo()` Returns ClasInfo for the contained Class
    `ClassNode` | `getClassNode()` Obtains a reference to the original AST for the MetaClass if it is available at runtime
    `MetaProperty` | `getEffectiveGetMetaProperty(Class sender, Object object, String name, boolean useSuper)` todo these special cases should be special MetaClasses maybe
    `MetaMethod` | `getMetaMethod(String name, Object[] argTypes)` @see MetaObjectProtocol#getMetaMethod(String, Object[])
    `List<MetaMethod>` | `getMetaMethods()` Retrieves the list of MetaMethods held by this class
    `MetaProperty` | `getMetaProperty(String name)` @see MetaObjectProtocol#getMetaProperty(String)
    `MetaMethod` | `getMethodWithCaching(Class sender, String methodName, Object[] arguments, boolean isCallToSuper)`
    `MetaMethod` | `getMethodWithoutCaching(Class sender, String methodName, Class[] arguments, boolean isCallToSuper)`
    `List<MetaMethod>` | `getMethods()` Retrieves the list of Methods held by the class
    `List<MetaProperty>` | `getProperties()` Get all the properties defined for this type
    `Object` | `getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)` @return the given property's value on the object
    `Object` | `getProperty(Object object, String property)`
    `MetaClassRegistry` | `getRegistry()` Returns the registry for this metaclass
    `MetaMethod` | `getStaticMetaMethod(String name, Object[] argTypes)` @see MetaObjectProtocol#getStaticMetaMethod(String, Object[])
    `protected Object` | `getSubclassMetaMethods(String methodName)`
    `protected LinkedList<CachedClass>` | `getSuperClasses()`
    `CachedClass` | `getTheCachedClass()` Returns the cached class for this metaclass
    `Class` | `getTheClass()` Returns the class this object this is the metaclass of.
    `int` | `getVersion()` Returns version of the contained Class
    `MetaProperty` | `hasProperty(Object obj, String name)` @see MetaObjectProtocol#hasProperty(Object,String)
    `void` | `incVersion()` Increments version of the contained Class
    `void` | `initialize()` Complete the initialisation process.
    `Object` | `invokeConstructor(Object[] arguments)`
    `Object` | `invokeMethod(Object object, String methodName, Object arguments)` Invoke a method on the given object with the given arguments.
    `Object` | `invokeMethod(Object object, String methodName, Object[] originalArguments)` Invokes a method on the given receiver for the specified arguments.
    `Object` | `invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)`
    `Object` | `invokeMissingMethod(Object instance, String methodName, Object[] arguments)` Invoke a missing method on the given object with the given arguments.
    `Object` | `invokeMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter)` Invoke a missing property on the given object with the given arguments.
    `Object` | `invokeStaticMethod(Object object, String methodName, Object[] arguments)`
    `protected Object` | `invokeStaticMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter)` Hook to deal with the case of MissingProperty for static properties.
    `boolean` | `isGroovyObject()` Return wether the class represented by this metaclass instance is an instance of the GroovyObject class
    `protected boolean` | `isInitialized()`
    `boolean` | `isModified()` Returns wether this metaclassimpl has been modified.
    `protected void` | `onGetPropertyFoundInHierarchy(MetaMethod method)`
    `protected void` | `onInvokeMethodFoundInHierarchy(MetaMethod method)`
    `protected void` | `onMixinMethodFound(MetaMethod method)`
    `protected void` | `onSetPropertyFoundInHierarchy(MetaMethod method)`
    `protected void` | `onSuperMethodFoundInHierarchy(MetaMethod method)`
    `protected void` | `onSuperPropertyFoundInHierarchy(MetaBeanProperty property)`
    `MetaMethod` | `pickMethod(String methodName, Class[] arguments)` Selects a method by name and argument classes.
    `List` | `respondsTo(Object obj, String name, Object[] argTypes)` @see MetaObjectProtocol#respondsTo(Object, String, Object[])
    `List` | `respondsTo(Object obj, String name)` @see MetaObjectProtocol#respondsTo(Object, String)
    `Constructor` | `retrieveConstructor(Class[] arguments)`
    `MetaMethod` | `retrieveConstructor(Object[] arguments)` This is a helper method added in Groovy 2.1.0, which is used only by indy.
    `MetaMethod` | `retrieveStaticMethod(String methodName, Object[] arguments)`
    `int` | `selectConstructorAndTransformArguments(int numberOfConstructors, Object[] arguments)`
    `void` | `setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass)`
    `void` | `setAttribute(Object object, String attribute, Object newValue)` Sets the value of an attribute (field).
    `void` | `setProperties(Object bean, Map map)` Sets a number of bean properties from the given Map where the keys are the String names of properties and the values are the values of the properties to set
    `void` | `setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)`
    `void` | `setProperty(Object object, String property, Object newValue)`
    `String` | `toString()` todo there is no CompileUnit in scope so class name checking won't work but that mostly affects the bytecode generation rather than viewing the AST

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Field Detail

    - #### public static final Object[] EMPTY_ARGUMENTS

    - #### protected static final String INVOKE_METHOD_METHOD

    - #### protected static final String METHOD_MISSING

    - #### protected static final String PROPERTY_MISSING

    - #### protected static final String STATIC_METHOD_MISSING

    - #### protected static final String STATIC_PROPERTY_MISSING

    - #### protected MetaMethod getPropertyMethod

    - #### protected MetaMethod invokeMethodMethod

    - #### protected final boolean isGroovyObject

    - #### protected final boolean isMap

    - #### protected final MetaMethodIndex metaMethodIndex

    - #### protected MetaClassRegistry registry

    - #### protected MetaMethod setPropertyMethod

    - #### protected final CachedClass theCachedClass

    - #### protected final Class theClass

  - ### Constructor Detail

    - #### public MetaClassImpl(Class theClass, MetaMethod[] add)

      Constructor

      Parameters:
        `theClass` - The class this is the metaclass dor
        `add` - The methods for this class

    - #### public MetaClassImpl(Class theClass)

      Constructor that sets the methods to null

      Parameters:
        `theClass` - The class this is the metaclass dor

    - #### public MetaClassImpl(MetaClassRegistry registry, Class theClass, MetaMethod[] add)

      Constructor with registry

      Parameters:
        `registry` - The metaclass registry for this MetaClass
        `theClass` - The class
        `add` - The methods

    - #### public MetaClassImpl(MetaClassRegistry registry, Class theClass)

      Constructor with registry setting methods to null

      Parameters:
        `registry` - The metaclass registry for this MetaClass
        `theClass` - The class

  - ### Method Detail

    - #### public void addMetaBeanProperty(MetaBeanProperty mp)

      Adds a new MetaBeanProperty to this MetaClass

      Parameters:
        `mp` - The MetaBeanProperty

    - #### public void addMetaMethod(MetaMethod method)

      adds a MetaMethod to this class. WARNING: this method will not do the neccessary steps for multimethod logic and using this method doesn't mean, that a method added here is replacing another method from a parent class completely. These steps are usually done by initialize, which means if you need these steps, you have to add the method before running initialize the first time.

      Parameters:
        `method` - the MetaMethod
      See Also:
        initialize()

    - #### protected void addMetaMethodToIndex(MetaMethod method, Header header)

    - #### public void addNewInstanceMethod(Method method)

      Adds an instance method to this metaclass.

      Parameters:
        `method` - The method to be added

    - #### public void addNewStaticMethod(Method method)

      Adds a static method to this metaclass.

      Parameters:
        `method` - The method to be added

    - #### protected void applyPropertyDescriptors(PropertyDescriptor[] propertyDescriptors)

    - #### protected final void checkIfGroovyObjectMethod(MetaMethod metaMethod)

      Checks if the metaMethod is a method from the GroovyObject interface such as setProperty, getProperty and invokeMethod

      Parameters:
        `metaMethod` - The metaMethod instance
      See Also:
        GroovyObject

    - #### protected void checkInitalised()

      checks if the initialisation of the class id complete. This method should be called as a form of assert, it is no way to test if there is still initialisation work to be done. Such logic must be implemented in a different way.

      throws:
        IllegalStateException if the initialisation is incomplete yet

    - #### protected Object chooseMethod(String methodName, Object methodOrList, Class[] arguments)

      Chooses the correct method to use from a list of methods which match by name.

      Parameters:
        `methodOrList` - the possible methods to choose from
        arguments

    - #### protected void clearInvocationCaches()

      remove all method call cache entries. This should be done if a method is added during runtime, but not by using a category.

    - #### public CallSite createConstructorSite(CallSite site, Object[] args)

      Create a CallSite

    - #### public CallSite createPogoCallCurrentSite(CallSite site, Class sender, Object[] args)

      Create a CallSite

    - #### public CallSite createPogoCallSite(CallSite site, Object[] args)

      Create a CallSite

    - #### public CallSite createPojoCallSite(CallSite site, Object receiver, Object[] args)

      Create a CallSite

    - #### public CallSite createStaticSite(CallSite site, Object[] args)

      Create a CallSite

    - #### protected void dropMethodCache(String name)

    - #### protected void dropStaticMethodCache(String name)

    - #### protected static MetaMethod findMethodInClassHierarchy(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass)

    - #### protected MetaMethod findMixinMethod(String methodName, Class[] arguments)

    - #### protected static MetaMethod findOwnMethod(Class instanceKlazz, String methodName, Class[] arguments, MetaClass metaClass, MetaMethod method)

    - #### protected MetaBeanProperty findPropertyInClassHierarchy(String propertyName, CachedClass theClass)

    - #### public MetaMethod[] getAdditionalMetaMethods()

      Retrieves a list of additional MetaMethods held by this class

      Returns:
        A list of MetaMethods

    - #### public Object getAttribute(Class sender, Object receiver, String messageName, boolean useSuper)

      Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.

      Parameters:
        `sender` - The class of the object that requested the attribute
        `receiver` - The instance
        `messageName` - The name of the attribute
        `useSuper` - Whether to look-up on the super class or not
      Returns:
        The attribute value

    - #### public Object getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass)

      Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.

      Parameters:
        `sender` - The class of the object that requested the attribute
        `object` - The instance the attribute is to retrived from
        `attribute` - The name of the attribute
        `useSuper` - Whether to look-up on the super class or not
        `fromInsideClass` - Whether the call was invoked from the inside or the outside of the class.
      Returns:
        The attribute value

    - #### public Object getAttribute(Object object, String attribute)

      Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.

      Parameters:
        `object` - The object to get the attribute from
        `attribute` - The name of the attribute
      Returns:
        The attribute value

    - #### public ClassInfo getClassInfo()

      Returns ClasInfo for the contained Class

      Returns:
        The ClassInfo for the contained class.

    - #### public ClassNode getClassNode()

      Obtains a reference to the original AST for the MetaClass if it is available at runtime

      Returns:
        The original AST or null if it cannot be returned

    - #### public MetaProperty getEffectiveGetMetaProperty(Class sender, Object object, String name, boolean useSuper)

      todo these special cases should be special MetaClasses maybe

    - #### public MetaMethod getMetaMethod(String name, Object[] argTypes)

      See Also:
        MetaObjectProtocol.getMetaMethod

    - #### public List<MetaMethod> getMetaMethods()

      Retrieves the list of MetaMethods held by this class

      Returns:
        A list of MetaMethods

    - #### public MetaProperty getMetaProperty(String name)

      See Also:
        MetaObjectProtocol.getMetaProperty

    - #### public MetaMethod getMethodWithCaching(Class sender, String methodName, Object[] arguments, boolean isCallToSuper)

    - #### public MetaMethod getMethodWithoutCaching(Class sender, String methodName, Class[] arguments, boolean isCallToSuper)

    - #### public List<MetaMethod> getMethods()

      Retrieves the list of Methods held by the class

      Returns:
        A list of Methods

    - #### public List<MetaProperty> getProperties()

      Get all the properties defined for this type

      Returns:
        a list of MetaProperty objects

    - #### public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)

      Returns:
        the given property's value on the object

    - #### public Object getProperty(Object object, String property)

      Retrieves a property on the given object for the specified arguments.

      Parameters:
        `object` - The Object which the property is being retrieved from
        `property` - The name of the property
      Returns:
        The properties value

    - #### public MetaClassRegistry getRegistry()

      Returns the registry for this metaclass

      Returns:
        The resgistry

    - #### public MetaMethod getStaticMetaMethod(String name, Object[] argTypes)

      See Also:
        MetaObjectProtocol.getStaticMetaMethod

    - #### protected Object getSubclassMetaMethods(String methodName)

    - #### protected LinkedList<CachedClass> getSuperClasses()

    - #### public final CachedClass getTheCachedClass()

      Returns the cached class for this metaclass

      Returns:
        The cached class.

    - #### public Class getTheClass()

      Returns the class this object this is the metaclass of.

      Returns:
        The class contained by this metaclass

    - #### public int getVersion()

      Returns version of the contained Class

      Returns:
        The version of the contained class.

    - #### public MetaProperty hasProperty(Object obj, String name)

      See Also:
        MetaObjectProtocol.hasProperty

    - #### public void incVersion()

      Increments version of the contained Class

    - #### public void initialize()

      Complete the initialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/properties is forbidden unless this method is called. This method should contain any initialisation code, taking a longer time to complete. An example is the creation of the Reflector. It is suggested to synchronize this method.

    - #### public Object invokeConstructor(Object[] arguments)

    - #### public Object invokeMethod(Object object, String methodName, Object arguments)

      Invoke a method on the given object with the given arguments.

      Parameters:
        `object` - The object the method should be invoked on.
        `methodName` - The name of the method to invoke.
        `arguments` - The arguments to the invoked method as null, a Tuple, an array or a single argument of any type.
      Returns:
        The result of the method invocation.

    - #### public Object invokeMethod(Object object, String methodName, Object[] originalArguments)

      Invokes a method on the given receiver for the specified arguments. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      Parameters:
        `object` - The object which the method was invoked on
        `methodName` - The name of the method
        `originalArguments` - The arguments to the method
      Returns:
        The return value of the method
      See Also:
        MetaClass.invokeMethod

    - #### public Object invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)

      Invokes a method on the given receiver for the specified arguments. The sender is the class that invoked the method on the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary

      Parameters:
        `sender` - The java.lang.Class instance that invoked the method
        `object` - The object which the method was invoked on
        `methodName` - The name of the method
        `originalArguments` - The arguments to the method
        `isCallToSuper` - Whether the method is a call to a super class method
        `fromInsideClass` - Whether the call was invoked from the inside or the outside of the class
      Returns:
        The return value of the method
      See Also:
        MetaClass.invokeMethod

    - #### public Object invokeMissingMethod(Object instance, String methodName, Object[] arguments)

      Invoke a missing method on the given object with the given arguments.

      Parameters:
        `instance` - The object the method should be invoked on.
        `methodName` - The name of the method to invoke.
        `arguments` - The arguments to the invoked method.
      Returns:
        The result of the method invocation.

    - #### public Object invokeMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter)

      Invoke a missing property on the given object with the given arguments.

      Parameters:
        `instance` - The object the method should be invoked on.
        `propertyName` - The name of the property to invoke.
        `optionalValue` - The (optional) new value for the property
        `isGetter` - Wether the method is a getter
      Returns:
        The result of the method invocation.

    - #### public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)

    - #### protected Object invokeStaticMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter)

      Hook to deal with the case of MissingProperty for static properties. The method will look attempt to look up "propertyMissing" handlers and invoke them otherwise thrown a MissingPropertyException

      Parameters:
        `instance` - The instance
        `propertyName` - The name of the property
        `optionalValue` - The value in the case of a setter
        `isGetter` - True if its a getter
      Returns:
        The value in the case of a getter or a MissingPropertyException

    - #### public boolean isGroovyObject()

      Return wether the class represented by this metaclass instance is an instance of the GroovyObject class

      Returns:
        true if this is a groovy class, false otherwise.

    - #### protected boolean isInitialized()

    - #### public boolean isModified()

      Returns wether this metaclassimpl has been modified. Since MetaClassImpl is not designed for modificaiton this method always returns false

      Returns:
        false

    - #### protected void onGetPropertyFoundInHierarchy(MetaMethod method)

    - #### protected void onInvokeMethodFoundInHierarchy(MetaMethod method)

    - #### protected void onMixinMethodFound(MetaMethod method)

    - #### protected void onSetPropertyFoundInHierarchy(MetaMethod method)

    - #### protected void onSuperMethodFoundInHierarchy(MetaMethod method)

    - #### protected void onSuperPropertyFoundInHierarchy(MetaBeanProperty property)

    - #### public MetaMethod pickMethod(String methodName, Class[] arguments)

      Selects a method by name and argument classes. This method does not search for an exact match, it searches for a compatible method. For this the method selection mechanism is used as provided by the implementation of this MetaClass. pickMethod may or may not be used during the method selection process when invoking a method. There is no warranty for that.

      throws:
        GroovyRuntimeException if there is more than one matching method
      Parameters:
        `methodName` - the name of the method to pick
        `arguments` - the method arguments
      Returns:
        a matching MetaMethod or null

    - #### public List respondsTo(Object obj, String name, Object[] argTypes)

      See Also:
        MetaObjectProtocol.respondsTo

    - #### public List respondsTo(Object obj, String name)

      See Also:
        MetaObjectProtocol.respondsTo

    - #### public Constructor retrieveConstructor(Class[] arguments)

    - #### public MetaMethod retrieveConstructor(Object[] arguments)

      This is a helper method added in Groovy 2.1.0, which is used only by indy. This method is for internal use only.

      Since:
        Groovy 2.1.0

    - #### public MetaMethod retrieveStaticMethod(String methodName, Object[] arguments)

    - #### public int selectConstructorAndTransformArguments(int numberOfConstructors, Object[] arguments)

    - #### public void setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass)

      Sets an attribute on the given receiver for the specified arguments. The sender is the class that is setting the attribute from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary

      Parameters:
        `sender` - The java.lang.Class instance that is mutating the property
        `object` - The Object which the property is being set on
        `attribute` - The name of the attribute,
        `newValue` - The new value of the attribute to set
        `useSuper` - Whether the call is to a super class property
        `fromInsideClass` - Whether the call was invoked from the inside or the outside of the class

    - #### public void setAttribute(Object object, String attribute, Object newValue)

      Sets the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.

      Parameters:
        `object` - The object to get the attribute from
        `attribute` - The name of the attribute
        `newValue` - The new value of the attribute

    - #### public void setProperties(Object bean, Map map)

      Sets a number of bean properties from the given Map where the keys are the String names of properties and the values are the values of the properties to set

    - #### public void setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)

      Retrieves a property on the given receiver for the specified arguments. The sender is the class that is requesting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      The useSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary

      Parameters:
        `sender` - The java.lang.Class instance that is mutating the property
        `object` - The Object which the property is being set on
        `name` - The name of the property
        `newValue` - The new value of the property to set
        `useSuper` - Whether the call is to a super class property
        `fromInsideClass` - Whether the call was invoked from the inside or the outside of the class.

    - #### public void setProperty(Object object, String property, Object newValue)

      Sets a property on the given object for the specified arguments.

      Parameters:
        `object` - The Object which the property is being retrieved from
        `property` - The name of the property
        `newValue` - The new value

    - #### public String toString()

      todo there is no CompileUnit in scope so class name checking won't work but that mostly affects the bytecode generation rather than viewing the AST