groovy.lang.MetaClass
| Modifier and Type | Class and Description |
|---|---|
| public static class | MetaClassRegistry.MetaClassCreationHandle
Class used as base for the creation of MetaClass implementations. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener
- the update listener listener)Adds a meta class change listener for constant meta classes |
| public void | addNonRemovableMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener
- the update listener listener)Adds a meta class change listener for constant meta classes. |
| public MetaClass | getMetaClass(Class<T> theClass)
The main function of the registry If a meta class exists then return it otherwise create one, put it in the registry and return it |
| public MetaClassRegistry. | Returns: The MetaClassCreationHandle instanceRetrieves the MetaClassCreationHandle that is responsible for constructing MetaClass instances |
| public MetaClassRegistryChangeEventListener[] | Returns: an array containing all change listenerReturns all registered class change listener for constant meta classes. |
| public Iterator | Returns: Iterator for the constant meta classesGets a snapshot of the current constant meta classes and returns it as Iterator. |
| public void | removeMetaClass(Class<T>
The Java class of the MetaClass to remove theClass)Removes a cached MetaClass from the registry |
| public void | removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener
- the update listener listener)Removes a meta class change listener for constant meta classes |
| public void | setMetaClass(Class<T>
The class theClass, MetaClass The MetaClass for theClass theMetaClass)Adds a metaclass to the registry for the given class |
| public void | setMetaClassCreationHandle(MetaClassRegistry.
The handle instance handleSets the MetaClassCreationHandle instance that is responsible for constructing instances |
| addMetaClassRegistryChangeEventListener | back to summary |
|---|---|
| public void addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener) Adds a meta class change listener for constant meta classes
| |
| addNonRemovableMetaClassRegistryChangeEventListener | back to summary |
|---|---|
| public void addNonRemovableMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener) Adds a meta class change listener for constant meta classes. This listener cannot be removed!
| |
| getMetaClass | back to summary |
|---|---|
| public MetaClass getMetaClass(Class<T> theClass) The main function of the registry If a meta class exists then return it otherwise create one, put it in the registry and return it | |
| getMetaClassCreationHandler | back to summary |
|---|---|
| public MetaClassRegistry. Retrieves the MetaClassCreationHandle that is responsible for constructing MetaClass instances
| |
| getMetaClassRegistryChangeEventListeners | back to summary |
|---|---|
| public MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners() Returns all registered class change listener for constant meta classes.
| |
| iterator | back to summary |
|---|---|
| public Iterator Gets a snapshot of the current constant meta classes and returns it as Iterator. Modifications done using this Iterator will not cause a ConcurrentModificationException. If a MetaClass is removed using this Iterator, then the MetaClass will only be removed if the MetaClass was not replaced by another MetaClass in the meantime. If a MetaClass is added while using this Iterator, then it will be part of the Iteration. If a MetaClass replaces another constant meta class, then the Iteration might show two meta classes for the same class. Note This Iterator may not used with multiple threads.
| |
| removeMetaClass | back to summary |
|---|---|
| public void removeMetaClass(Class<T> theClass) Removes a cached MetaClass from the registry
| |
| removeMetaClassRegistryChangeEventListener | back to summary |
|---|---|
| public void removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener) Removes a meta class change listener for constant meta classes
| |
| setMetaClass | back to summary |
|---|---|
| public void setMetaClass(Class<T> theClass, MetaClass theMetaClass) Adds a metaclass to the registry for the given class | |
| setMetaClassCreationHandle | back to summary |
|---|---|
| public void setMetaClassCreationHandle(MetaClassRegistry. Sets the MetaClassCreationHandle instance that is responsible for constructing instances
| |
Warning
experimental code, likely to change soon
| Modifier and Type | Field and Description |
|---|---|
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final MetaClass | create(Class<T>
The class to create a metaclass for theClass, MetaClassRegistry The metaclass registry the metaclass we be registered in. registry)Creates a metaclass implementation for theClass. |
| protected MetaClass | |
| private MetaClass | |
| public boolean | |
| public void | setDisableCustomMetaClassLookup(boolean
flag saying to disable lookup of custom meta classes disableCustomMetaClassLookup)Set flag saying to disable lookup of custom meta classes It's enough to call this method only once in your application for handle which was set in to registry as every new handle will inherit this property |
| disableCustomMetaClassLookup | back to summary |
|---|---|
| private boolean disableCustomMetaClassLookup | |
| MetaClassCreationHandle | back to summary |
|---|---|
| public MetaClassCreationHandle() | |
| create | back to summary |
|---|---|
| public final MetaClass create(Class<T> theClass, MetaClassRegistry registry) Creates a metaclass implementation for theClass.
| |
| createNormalMetaClass | back to summary |
|---|---|
| protected MetaClass createNormalMetaClass(Class<T> theClass, MetaClassRegistry registry) | |
| createWithCustomLookup | back to summary |
|---|---|
| private MetaClass createWithCustomLookup(Class<T> theClass, MetaClassRegistry registry) | |
| isDisableCustomMetaClassLookup | back to summary |
|---|---|
| public boolean isDisableCustomMetaClassLookup() Returns whether custom meta classes are disabled. | |
| setDisableCustomMetaClassLookup | back to summary |
|---|---|
| public void setDisableCustomMetaClassLookup(boolean disableCustomMetaClassLookup) Set flag saying to disable lookup of custom meta classes It's enough to call this method only once in your application for handle which was set in to registry as every new handle will inherit this property
| |