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()
MetaClassRegistry
,
MetaClassRegistry.MetaClassCreationHandle
,
MetaClassRegistryImpl.setMetaClassCreationHandle(groovy.lang.MetaClassRegistry.MetaClassCreationHandle)
Modifier and Type | Field and Description |
---|---|
static ExpandoMetaClassCreationHandle |
instance |
Constructor and Description |
---|
ExpandoMetaClassCreationHandle() |
Modifier and Type | Method and Description |
---|---|
protected MetaClass |
createNormalMetaClass(java.lang.Class theClass,
MetaClassRegistry registry) |
static void |
disable() |
static void |
enable()
Enables the ExpandoMetaClassCreationHandle with the registry
ExpandoMetaClassCreationHandle.enable(); |
boolean |
hasModifiedMetaClass(ExpandoMetaClass emc) |
void |
registerModifiedMetaClass(ExpandoMetaClass emc)
Registers a modified ExpandoMetaClass with the creation handle
|
create, isDisableCustomMetaClassLookup, setDisableCustomMetaClassLookup
public static final ExpandoMetaClassCreationHandle instance
protected MetaClass createNormalMetaClass(java.lang.Class theClass, MetaClassRegistry registry)
createNormalMetaClass
in class MetaClassRegistry.MetaClassCreationHandle
public void registerModifiedMetaClass(ExpandoMetaClass emc)
emc
- The EMCpublic boolean hasModifiedMetaClass(ExpandoMetaClass emc)
public static void enable()
Enables the ExpandoMetaClassCreationHandle with the registry
ExpandoMetaClassCreationHandle.enable();
public static void disable()