groovy.lang
Class MetaClassRegistry
java.lang.Object
groovy.lang.MetaClassRegistry
- public class MetaClassRegistry
- extends java.lang.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: 1.10 $
- Author:
- James Strachan
Method Summary |
MetaClass |
getMetaClass(java.lang.Class theClass)
|
java.lang.Class |
loadClass(java.lang.String name)
|
java.lang.Class |
loadClass(java.lang.String name,
byte[] bytecode)
A helper class to load meta class bytecode into the class loader |
void |
setMetaClass(java.lang.Class theClass,
MetaClass theMetaClass)
Registers a new MetaClass in the registry to customize the type |
boolean |
useAccessible()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MetaClassRegistry
public MetaClassRegistry()
MetaClassRegistry
public MetaClassRegistry(boolean useAccessible)
- Parameters:
useAccessible
- defines whether or not the AccessibleObject.setAccessible()
method will be called to enable access to all methods when using reflection
getMetaClass
public MetaClass getMetaClass(java.lang.Class theClass)
setMetaClass
public void setMetaClass(java.lang.Class theClass,
MetaClass theMetaClass)
- Registers a new MetaClass in the registry to customize the type
- Parameters:
theClass
- theMetaClass
-
useAccessible
public boolean useAccessible()
loadClass
public java.lang.Class loadClass(java.lang.String name,
byte[] bytecode)
throws java.lang.ClassNotFoundException
- A helper class to load meta class bytecode into the class loader
- Throws:
java.lang.ClassNotFoundException
loadClass
public java.lang.Class loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
Copyright © 2003-2004 The Codehaus. All Rights Reserved.