| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl
public class MetaClassRegistryImpl
A registry of MetaClass instances which caches introspection & reflection information and allows methods to be dynamically added to existing classes at runtime
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from interface groovy.lang.MetaClassRegistry | 
|---|
MetaClassRegistry.MetaClassCreationHandle | 
| Field Summary | |
|---|---|
static int | 
DONT_LOAD_DEFAULT
 | 
static int | 
LOAD_DEFAULT
 | 
| Constructor Summary | |
|---|---|
MetaClassRegistryImpl()
 | 
|
MetaClassRegistryImpl(boolean useAccessible)
 | 
|
MetaClassRegistryImpl(int loadDefault)
 | 
|
MetaClassRegistryImpl(int loadDefault,
                      boolean useAccessible)
 | 
|
| Method Summary | |
|---|---|
 void | 
addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
Adds a listener for constant meta classes.  | 
protected  void | 
fireConstantMetaClassUpdate(Object obj,
                            Class c,
                            MetaClass oldMC,
                            MetaClass newMc)
Causes the execution of all registered listeners.  | 
static MetaClassRegistry | 
getInstance(int includeExtension)
Singleton of MetaClassRegistry.  | 
 FastArray | 
getInstanceMethods()
 | 
 MetaClass | 
getMetaClass(Class theClass)
 | 
 MetaClass | 
getMetaClass(Object obj)
 | 
 MetaClassRegistry.MetaClassCreationHandle | 
getMetaClassCreationHandler()
Gets a handle internally used to create MetaClass implementations WARNING: experimental code, likely to change soon  | 
 MetaClassRegistryChangeEventListener[] | 
getMetaClassRegistryChangeEventListeners()
Gets an array of of all registered ConstantMetaClassListener instances.  | 
 FastArray | 
getStaticMethods()
 | 
 Iterator | 
iterator()
Returns an iterator to iterate over all constant meta classes.  | 
 void | 
removeMetaClass(Class theClass)
Removes a cached MetaClass from the registry  | 
 void | 
removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
Removes a constant meta class listener.  | 
 void | 
setMetaClass(Class theClass,
             MetaClass theMetaClass)
Registers a new MetaClass in the registry to customize the type  | 
 void | 
setMetaClass(Object obj,
             MetaClass theMetaClass)
 | 
 void | 
setMetaClassCreationHandle(MetaClassRegistry.MetaClassCreationHandle handle)
Sets a handle internally used to create MetaClass implementations.  | 
 boolean | 
useAccessible()
 | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int LOAD_DEFAULT
public static final int DONT_LOAD_DEFAULT
| Constructor Detail | 
|---|
public MetaClassRegistryImpl()
public MetaClassRegistryImpl(int loadDefault)
public MetaClassRegistryImpl(boolean useAccessible)
useAccessible - defines whether or not the AccessibleObject.setAccessible(boolean)
                      method will be called to enable access to all methods when using reflection
public MetaClassRegistryImpl(int loadDefault,
                             boolean useAccessible)
| Method Detail | 
|---|
public final MetaClass getMetaClass(Class theClass)
getMetaClass in interface MetaClassRegistrypublic MetaClass getMetaClass(Object obj)
public void removeMetaClass(Class theClass)
MetaClassRegistry
removeMetaClass in interface MetaClassRegistrytheClass - The Java class of the MetaClass to remove
public void setMetaClass(Class theClass,
                         MetaClass theMetaClass)
setMetaClass in interface MetaClassRegistrytheClass - theMetaClass - 
public void setMetaClass(Object obj,
                         MetaClass theMetaClass)
public boolean useAccessible()
public MetaClassRegistry.MetaClassCreationHandle getMetaClassCreationHandler()
getMetaClassCreationHandler in interface MetaClassRegistrypublic void setMetaClassCreationHandle(MetaClassRegistry.MetaClassCreationHandle handle)
setMetaClassCreationHandle in interface MetaClassRegistryhandle - the handlepublic void addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
addMetaClassRegistryChangeEventListener in interface MetaClassRegistrylistener - the listenerpublic void removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
removeMetaClassRegistryChangeEventListener in interface MetaClassRegistrylistener - the listener
protected void fireConstantMetaClassUpdate(Object obj,
                                           Class c,
                                           MetaClass oldMC,
                                           MetaClass newMc)
obj - object instance if the MetaClass change is on a per-instance metaclass (or null if global)c - the classoldMC - the old MetaClassnewMc - the new MetaClasspublic MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners()
getMetaClassRegistryChangeEventListeners in interface MetaClassRegistrypublic static MetaClassRegistry getInstance(int includeExtension)
includeExtension - 
public FastArray getInstanceMethods()
public FastArray getStaticMethods()
public Iterator iterator()
iterator in interface MetaClassRegistry
  | 
Copyright © 2003-2012 The Codehaus. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||