|
Groovy 1.7.9 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl
public class MetaClassRegistryImpl extends Object
A registry of MetaClass instances which caches introspection & reflection information and allows methods to be dynamically added to existing classes at runtime
Field Summary | |
---|---|
static int |
DONT_LOAD_DEFAULT
|
static int |
LOAD_DEFAULT
|
Constructor Summary | |
MetaClassRegistryImpl()
|
|
MetaClassRegistryImpl(int loadDefault)
|
|
MetaClassRegistryImpl(boolean useAccessible)
@param useAccessible defines whether or not the AccessibleObject.setAccessible method will be called to enable access to all methods when using reflection |
|
MetaClassRegistryImpl(int loadDefault, boolean useAccessible)
|
Method Summary | |
---|---|
void
|
addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
Adds a listener for constant meta classes. |
protected void
|
fireConstantMetaClassUpdate(Class c, 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)
|
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)
|
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(MetaClassCreationHandle handle)
Sets a handle internally used to create MetaClass implementations. |
boolean
|
useAccessible()
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
public static final int DONT_LOAD_DEFAULT
public static final int LOAD_DEFAULT
Constructor Detail |
---|
public MetaClassRegistryImpl()
public MetaClassRegistryImpl(int loadDefault)
public MetaClassRegistryImpl(boolean useAccessible)
useAccessible
- defines whether or not the AccessibleObject.setAccessible
method will be called to enable access to all methods when using reflection
public MetaClassRegistryImpl(int loadDefault, boolean useAccessible)
Method Detail |
---|
public void addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
listener
- the listener
protected void fireConstantMetaClassUpdate(Class c, MetaClass newMc)
c
- the classnewMc
- the new MetaClass
public static MetaClassRegistry getInstance(int includeExtension)
public FastArray getInstanceMethods()
public final MetaClass getMetaClass(Class theClass)
public MetaClass getMetaClass(Object obj)
public MetaClassCreationHandle getMetaClassCreationHandler()
public MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners()
public FastArray getStaticMethods()
public Iterator iterator()
public void removeMetaClass(Class theClass)
public void removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
listener
- the listener
public void setMetaClass(Class theClass, MetaClass theMetaClass)
public void setMetaClass(Object obj, MetaClass theMetaClass)
public void setMetaClassCreationHandle(MetaClassCreationHandle handle)
handle
- the handle
public boolean useAccessible()
Copyright © 2003-2010 The Codehaus. All rights reserved.