groovy.lang
Class MetaClassRegistry
java.lang.Object
groovy.lang.MetaClassRegistry
public class MetaClassRegistry
- extends Object
A registery of MetaClass instances which caches introspection &
reflection information and allows methods to be dynamically added to
existing classes at runtime
- Version:
- $Revision: 4554 $
- Author:
- James Strachan, John Wilson, Jochen Theodorou
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOAD_DEFAULT
public static final int LOAD_DEFAULT
- See Also:
- Constant Field Values
DONT_LOAD_DEFAULT
public static final int DONT_LOAD_DEFAULT
- See Also:
- Constant Field Values
MetaClassRegistry
public MetaClassRegistry()
MetaClassRegistry
public MetaClassRegistry(int loadDefault)
MetaClassRegistry
public MetaClassRegistry(boolean useAccessible)
- Parameters:
useAccessible
- defines whether or not the AccessibleObject.setAccessible(boolean)
method will be called to enable access to all methods when using reflection
MetaClassRegistry
public MetaClassRegistry(int loadDefault,
boolean useAccessible)
getMetaClass
public MetaClass getMetaClass(Class theClass)
removeMetaClass
public void removeMetaClass(Class theClass)
setMetaClass
public void setMetaClass(Class theClass,
MetaClass theMetaClass)
- Registers a new MetaClass in the registry to customize the type
- Parameters:
theClass
- theMetaClass
-
useAccessible
public boolean useAccessible()
getInstance
public static MetaClassRegistry getInstance(int includeExtension)
- Singleton of MetaClassRegistry. Shall we use threadlocal to store the instance?
- Parameters:
includeExtension
-
loadReflector
public Reflector loadReflector(Class theClass,
List methods)
Copyright © 2003-2009 The Codehaus. All Rights Reserved.