Package: groovy.lang

## [Java] Class MetaClassImpl

- groovy.lang.MetaClassImpl

- All Implemented Interfaces and Traits:
    MetaClass, MutableMetaClass

      public class MetaClassImpl
      extends Object
      implements MetaClass, MutableMetaClass

  Allows methods to be dynamically added to existing classes at runtime

  See Also:
    MetaClass

- - ### 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 Params | Return Type | Name and description
    --- | --- | ---
    `` | `public MetaMethod` | `getMetaMethod(String name, Object[] argTypes)` See Also: MetaObjectProtocol.getMetaMethod
    `` | `public MetaProperty` | `getMetaProperty(String name)` See Also: MetaObjectProtocol.getMetaProperty
    `` | `public MetaClassRegistry` | `getRegistry()` Returns the registry for this metaclass
    `` | `public MetaMethod` | `getStaticMetaMethod(String name, Object[] argTypes)` See Also: MetaObjectProtocol.getStaticMetaMethod
    `` | `protected LinkedList<CachedClass>` | `getSuperClasses()`
    `` | `public final CachedClass` | `getTheCachedClass()` Returns the cached class for this metaclass
    `` | `public Class` | `getTheClass()` Returns the class this metaclass represents.
    `` | `public MetaProperty` | `hasProperty(Object obj, String name)` See Also: MetaObjectProtocol.hasProperty
    `` | `public boolean` | `isGroovyObject()` Indicates if the represented class is an instance of the GroovyObject class.
    `` | `public void` | `methodNameAction(Class<?> clazz, Cache entry)`
    `` | `public List<MetaMethod>` | `respondsTo(Object obj, String name, Object[] argTypes)` See Also: MetaObjectProtocol.respondsTo
    `` | `public List<MetaMethod>` | `respondsTo(Object obj, String name)` See Also: MetaObjectProtocol.respondsTo
    `` | `public boolean` | `skipClass(Class<?> clazz)`

  - ### Inherited Methods Summary

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

- - ### 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 for
        `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 for

    - #### 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

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

      See Also:
        MetaObjectProtocol.getMetaMethod

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

      See Also:
        MetaObjectProtocol.getMetaProperty

    - #### public MetaClassRegistry getRegistry()

      Returns the registry for this metaclass

      Returns:
        The registry

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

      See Also:
        MetaObjectProtocol.getStaticMetaMethod

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

    - #### public final CachedClass getTheCachedClass()

      Returns the cached class for this metaclass

      Returns:
        The cached class.

    - #### @Override
      public Class getTheClass()

      Returns the class this metaclass represents.

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

      See Also:
        MetaObjectProtocol.hasProperty

    - #### public boolean isGroovyObject()

      Indicates if the represented class is an instance of the GroovyObject class.

    - #### @Override
      public void methodNameAction(Class<?> clazz, Cache entry)

    - #### @Override
      public List<MetaMethod> respondsTo(Object obj, String name, Object[] argTypes)

      See Also:
        MetaObjectProtocol.respondsTo

    - #### @Override
      public List<MetaMethod> respondsTo(Object obj, String name)

      See Also:
        MetaObjectProtocol.respondsTo

    - #### @Override
      public boolean skipClass(Class<?> clazz)