Package: org.codehaus.groovy.runtime.metaclass

## [Java] Class ClosureMetaClass

- org.codehaus.groovy.runtime.metaclass.ClosureMetaClass

-     public final class ClosureMetaClass
      extends MetaClassImpl

  A metaclass for closures generated by the Groovy compiler. These classes have special characteristics this MetaClass uses. One of these is that a generated Closure has only additional doCall methods, all other methods are in the Closure class as well. To use this fact this MetaClass uses a MetaClass for Closure as static field And delegates calls to this MetaClass if needed. This allows a lean implementation for this MetaClass. Multiple generated closures will then use the same MetaClass for Closure. For static dispatching this class uses the MetaClass of Class, again all instances of this class will share that MetaClass. The Class MetaClass is initialized lazy, because most operations do not need this MetaClass.

  The Closure and Class metaclasses are not replaceable.

  This MetaClass is for internal usage only!

  Since:
    1.5

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class MetaClassImpl` | `EMPTY_ARGUMENTS, INVOKE_METHOD_METHOD, METHOD_MISSING, PROPERTY_MISSING, STATIC_METHOD_MISSING, STATIC_PROPERTY_MISSING, getPropertyMethod, invokeMethodMethod, isGroovyObject, isMap, metaMethodIndex, registry, setPropertyMethod, theCachedClass, theClass`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ClosureMetaClass(MetaClassRegistry registry, Class theClass)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `addMetaBeanProperty(MetaBeanProperty mp)`
    `` | `public void` | `addMetaMethod(MetaMethod method)`
    `` | `public void` | `addNewInstanceMethod(Method method)`
    `` | `public void` | `addNewStaticMethod(Method method)`
    `` | `protected void` | `applyPropertyDescriptors(PropertyDescriptor[] propertyDescriptors)`
    `` | `public CallSite` | `createPogoCallCurrentSite(CallSite site, Class sender, Object[] args)`
    `` | `public CallSite` | `createPogoCallSite(CallSite site, Object[] args)`
    `` | `public CallSite` | `createPojoCallSite(CallSite site, Object receiver, Object[] args)`
    `` | `public Object` | `getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass)`
    `` | `public List<MetaMethod>` | `getMetaMethods()`
    `` | `public MetaProperty` | `getMetaProperty(String name)`
    `` | `public MetaMethod` | `getMethodWithoutCaching(int index, Class sender, String methodName, Class[] arguments, boolean isCallToSuper)`
    `` | `public List<MetaMethod>` | `getMethods()`
    `` | `public List<MetaProperty>` | `getProperties()`
    `` | `public Object` | `getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)`
    `` | `public MetaMethod` | `getStaticMetaMethod(String name, Object[] args)`
    `` | `public MetaMethod` | `getStaticMetaMethod(String name, Class[] argTypes)`
    `` | `public void` | `initialize()`
    `` | `public Object` | `invokeMethod(Class sender, Object object, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)`
    `` | `public Object` | `invokeStaticMethod(Object object, String methodName, Object[] arguments)`
    `` | `public MetaMethod` | `pickMethod(String methodName, Class[] argumentTypes)`
    `` | `public static void` | `resetCachedMetaClasses()`
    `` | `public List` | `respondsTo(Object obj, String name, Object[] argTypes)`
    `` | `public List` | `respondsTo(Object obj, String name)`
    `` | `public Constructor` | `retrieveConstructor(Class[] arguments)`
    `` | `public MetaMethod` | `retrieveStaticMethod(String methodName, Class[] arguments)`
    `` | `public void` | `setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass)`
    `` | `public void` | `setProperties(Object bean, Map map)`
    `` | `public void` | `setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class MetaClassImpl` | `addMetaBeanProperty, addMetaMethod, addMetaMethodToIndex, addNewInstanceMethod, addNewStaticMethod, applyPropertyDescriptors, checkIfGroovyObjectMethod, checkInitalised, chooseMethod, clearInvocationCaches, createConstructorSite, createErrorMessageForAmbiguity, createPogoCallCurrentSite, createPogoCallSite, createPojoCallSite, createStaticSite, createTransformMetaMethod, doChooseMostSpecificParams, dropMethodCache, dropStaticMethodCache, findMethodInClassHierarchy, findMixinMethod, findOwnMethod, findPropertyInClassHierarchy, getAdditionalMetaMethods, getAttribute, getAttribute, getAttribute, getClassInfo, getClassNode, getEffectiveGetMetaProperty, getMetaMethod, getMetaMethods, getMetaProperty, getMethodWithCaching, getMethodWithoutCaching, getMethods, getNonClosureOuter, getProperties, getProperty, getProperty, getRegistry, getStaticMetaMethod, getSubclassMetaMethods, getSuperClasses, getTheCachedClass, getTheClass, getVersion, handleMatches, hasCustomInvokeMethod, hasCustomStaticInvokeMethod, hasProperty, incVersion, initialize, invokeConstructor, invokeMethod, invokeMethod, invokeMethod, invokeMissingMethod, invokeMissingProperty, invokeStaticMethod, invokeStaticMissingProperty, isGroovyObject, isInitialized, isModified, isPermissivePropertyAccess, onGetPropertyFoundInHierarchy, onInvokeMethodFoundInHierarchy, onMixinMethodFound, onSetPropertyFoundInHierarchy, onSuperMethodFoundInHierarchy, onSuperPropertyFoundInHierarchy, pickMethod, reinitialize, respondsTo, respondsTo, retrieveConstructor, retrieveConstructor, retrieveStaticMethod, selectConstructorAndTransformArguments, setAttribute, setAttribute, setInitialized, setPermissivePropertyAccess, setProperties, setProperty, setProperty, toString`

- - ### Constructor Detail

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

  - ### Method Detail

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    - #### public void initialize()

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

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

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

    - #### public static void resetCachedMetaClasses()

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

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

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

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

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

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

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