Groovy 2.2.1

org.codehaus.groovy.runtime.metaclass
[Java] Class MetaClassRegistryImpl

java.lang.Object
  org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl
All Implemented Interfaces:
MetaClassRegistry

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

Authors:
James Strachan
John Wilson
Jochen Theodorou
Graeme Rocher
Alex Tkachman
Version:
\$Revision\$


Field Summary
static int DONT_LOAD_DEFAULT

static int LOAD_DEFAULT

static String MODULE_META_INF_FILE

@deprecated Use instead

 
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.

void addNonRemovableMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)

Adds a listener for constant meta classes.

protected void fireConstantMetaClassUpdate(Object obj, Class c, MetaClass oldMC, MetaClass newMc)

static MetaClassRegistry getInstance(int includeExtension)

Singleton of MetaClassRegistry.

FastArray getInstanceMethods()

MetaClass getMetaClass(Class theClass)

MetaClass getMetaClass(Object obj)

MetaClassCreationHandle getMetaClassCreationHandler()

MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners()

Gets an array of of all registered ConstantMetaClassListener instances.

ExtensionModuleRegistry getModuleRegistry()

FastArray getStaticMethods()

Iterator iterator()

void registerExtensionModuleFromProperties(Properties properties, ClassLoader classLoader, Map map)

void removeMetaClass(Class theClass)

void removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)

void setMetaClass(Class theClass, MetaClass theMetaClass)

void setMetaClass(Object obj, MetaClass theMetaClass)

void setMetaClassCreationHandle(MetaClassCreationHandle handle)

boolean useAccessible()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

DONT_LOAD_DEFAULT

public static final int DONT_LOAD_DEFAULT


LOAD_DEFAULT

public static final int LOAD_DEFAULT


MODULE_META_INF_FILE

public static final String MODULE_META_INF_FILE
deprecated:
Use instead


 
Constructor Detail

MetaClassRegistryImpl

public MetaClassRegistryImpl()


MetaClassRegistryImpl

public MetaClassRegistryImpl(int loadDefault)


MetaClassRegistryImpl

public MetaClassRegistryImpl(boolean useAccessible)
Parameters:
useAccessible - defines whether or not the AccessibleObject.setAccessible method will be called to enable access to all methods when using reflection


MetaClassRegistryImpl

public MetaClassRegistryImpl(int loadDefault, boolean useAccessible)


 
Method Detail

addMetaClassRegistryChangeEventListener

public void addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
Adds a listener for constant meta classes.
Parameters:
listener - the listener


addNonRemovableMetaClassRegistryChangeEventListener

public void addNonRemovableMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)
Adds a listener for constant meta classes. This listener cannot be removed!
Parameters:
listener - the listener


fireConstantMetaClassUpdate

protected void fireConstantMetaClassUpdate(Object obj, Class c, MetaClass oldMC, MetaClass newMc)


getInstance

public static MetaClassRegistry getInstance(int includeExtension)
Singleton of MetaClassRegistry.
Parameters:
includeExtension
Returns:
the registry


getInstanceMethods

public FastArray getInstanceMethods()


getMetaClass

public final MetaClass getMetaClass(Class theClass)


getMetaClass

public MetaClass getMetaClass(Object obj)


getMetaClassCreationHandler

public MetaClassCreationHandle getMetaClassCreationHandler()


getMetaClassRegistryChangeEventListeners

public MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners()
Gets an array of of all registered ConstantMetaClassListener instances.


getModuleRegistry

public ExtensionModuleRegistry getModuleRegistry()


getStaticMethods

public FastArray getStaticMethods()


iterator

public Iterator iterator()


registerExtensionModuleFromProperties

public void registerExtensionModuleFromProperties(Properties properties, ClassLoader classLoader, Map map)


removeMetaClass

public void removeMetaClass(Class theClass)


removeMetaClassRegistryChangeEventListener

public void removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener)


setMetaClass

public void setMetaClass(Class theClass, MetaClass theMetaClass)


setMetaClass

public void setMetaClass(Object obj, MetaClass theMetaClass)


setMetaClassCreationHandle

public void setMetaClassCreationHandle(MetaClassCreationHandle handle)


useAccessible

public boolean useAccessible()


 

Copyright © 2003-2013 The Codehaus. All rights reserved.