Package: groovy.lang

## [Java] Class ExpandoMetaClassCreationHandle

- groovy.lang.ExpandoMetaClassCreationHandle

-     public class ExpandoMetaClassCreationHandle
      extends MetaClassRegistry.MetaClassCreationHandle

  A handle for the MetaClassRegistry that changes all classes loaded into the Grails VM to use ExpandoMetaClass instances

  The handle should be registered with the Groovy runtime before Groovy loads, for example in your main method. `GroovySystem.metaClassRegistry.metaClassCreationHandle = new ExpandoMetaClassCreationHandle()`

  See Also:
    MetaClassRegistry
    groovy.lang.MetaClassRegistry.MetaClassCreationHandle
    MetaClassRegistryImpl.setMetaClassCreationHandle
  Since:
    1.5

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static ExpandoMetaClassCreationHandle` | `instance` | Shared creation handle instance used when expando meta classes are globally enabled.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected MetaClass` | `createNormalMetaClass(Class theClass, MetaClassRegistry registry)` * Creates the standard meta class implementation for the supplied type. * * Parameters: `theClass` - the class that requires a meta class * `registry` - the registry creating the meta class * Returns: the default meta class implementation for the type
    `` | `public static void` | `disable()` Restores the default meta class creation handle for the Groovy runtime.
    `` | `public static void` | `enable()`
    `` | `public boolean` | `hasModifiedMetaClass(ExpandoMetaClass emc)` Checks whether the supplied expando meta class has been registered as modified.
    `` | `public void` | `registerModifiedMetaClass(ExpandoMetaClass emc)` Registers a modified ExpandoMetaClass with the creation handle

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class MetaClassRegistry.MetaClassCreationHandle` | `create, createNormalMetaClass, isDisableCustomMetaClassLookup, setDisableCustomMetaClassLookup`

- - ### Field Detail

    - #### public static final ExpandoMetaClassCreationHandle instance

      Shared creation handle instance used when expando meta classes are globally enabled.

  - ### Method Detail

    - #### protected MetaClass createNormalMetaClass(Class theClass, MetaClassRegistry registry)

      * Creates the standard meta class implementation for the supplied type. * *

      Parameters:
        `theClass` - the class that requires a meta class *
        `registry` - the registry creating the meta class *
      Returns:
        the default meta class implementation for the type

    - #### public static void disable()

      Restores the default meta class creation handle for the Groovy runtime.

    - #### public static void enable()

      Enables the ExpandoMetaClassCreationHandle with the registry `ExpandoMetaClassCreationHandle.enable();`

    - #### public boolean hasModifiedMetaClass(ExpandoMetaClass emc)

      Checks whether the supplied expando meta class has been registered as modified.

      Parameters:
        `emc` - the expando meta class to inspect
      Returns:
        `true` if the class info retains a modified expando instance

    - #### public void registerModifiedMetaClass(ExpandoMetaClass emc)

      Registers a modified ExpandoMetaClass with the creation handle

      Parameters:
        `emc` - The EMC