Package org.codehaus.groovy.runtime
Class HandleMetaClass
java.lang.Object
groovy.lang.DelegatingMetaClass
org.codehaus.groovy.runtime.HandleMetaClass
- All Implemented Interfaces:
- GroovyObject,- MetaClass,- MetaObjectProtocol,- MutableMetaClass
public class HandleMetaClass extends DelegatingMetaClass
- 
Field SummaryFields inherited from class groovy.lang.DelegatingMetaClassdelegate
- 
Constructor SummaryConstructors Constructor Description HandleMetaClass(MetaClass mc)HandleMetaClass(MetaClass mc, java.lang.Object obj)
- 
Method SummaryModifier and Type Method Description voidaddMetaBeanProperty(MetaBeanProperty metaBeanProperty)Adds a new MetaBeanProperty to the MetaClassvoidaddMetaMethod(MetaMethod metaMethod)Adds a new MetaMethod to the MetaClassvoidaddNewInstanceMethod(java.lang.reflect.Method method)adds a new instance method to this MetaClass.voidaddNewStaticMethod(java.lang.reflect.Method method)adds a new static method to this MetaClass.booleanequals(java.lang.Object obj)java.lang.ObjectgetProperty(java.lang.String property)Retrieves a property value.voidinitialize()Complete the initialisation process.java.lang.ObjectinvokeMethod(java.lang.String name, java.lang.Object args)Invokes the given method.GroovyObjectreplaceDelegate()voidsetProperty(java.lang.String property, java.lang.Object newValue)Sets the given property to the new value.Methods inherited from class groovy.lang.DelegatingMetaClassgetAdaptee, getAttribute, getAttribute, getClassNode, getMetaClass, getMetaMethod, getMetaMethods, getMetaProperty, getMethods, getProperties, getProperty, getProperty, getStaticMetaMethod, getStaticMetaMethod, getTheClass, hashCode, hasProperty, invokeConstructor, invokeMethod, invokeMethod, invokeMethod, invokeMissingMethod, invokeMissingProperty, invokeStaticMethod, isGroovyObject, isModified, pickMethod, respondsTo, respondsTo, selectConstructorAndTransformArguments, setAdaptee, setAttribute, setAttribute, setMetaClass, setProperty, setProperty, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
- 
Constructor Details- 
HandleMetaClass
- 
HandleMetaClass
 
- 
- 
Method Details- 
initializepublic void initialize()Description copied from interface:MetaClassComplete the initialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/properties is forbidden unless this method is called. This method should contain any initialisation code, taking a longer time to complete. An example is the creation of the Reflector. It is suggested to synchronize this method.- Specified by:
- initializein interface- MetaClass
- Overrides:
- initializein class- DelegatingMetaClass
 
- 
replaceDelegate
- 
invokeMethodpublic java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)Description copied from interface:GroovyObjectInvokes the given method.- Specified by:
- invokeMethodin interface- GroovyObject
- Overrides:
- invokeMethodin class- DelegatingMetaClass
- Parameters:
- name- the name of the method to call
- args- the arguments to use for the method call
- Returns:
- the result of invoking the method
 
- 
getPropertypublic java.lang.Object getProperty(java.lang.String property)Description copied from interface:GroovyObjectRetrieves a property value.- Specified by:
- getPropertyin interface- GroovyObject
- Overrides:
- getPropertyin class- DelegatingMetaClass
- Parameters:
- property- the name of the property of interest
- Returns:
- the given property
 
- 
setPropertypublic void setProperty(java.lang.String property, java.lang.Object newValue)Description copied from interface:GroovyObjectSets the given property to the new value.- Specified by:
- setPropertyin interface- GroovyObject
- Overrides:
- setPropertyin class- DelegatingMetaClass
- Parameters:
- property- the name of the property of interest
- newValue- the new value for the property
 
- 
addNewInstanceMethodpublic void addNewInstanceMethod(java.lang.reflect.Method method)Description copied from interface:MutableMetaClassadds a new instance method to this MetaClass. Instance methods are able to overwrite the original methods of the class. Calling this method should not be done after initialise was called.- Specified by:
- addNewInstanceMethodin interface- MutableMetaClass
- Overrides:
- addNewInstanceMethodin class- DelegatingMetaClass
- Parameters:
- method- the method to be added
 
- 
addNewStaticMethodpublic void addNewStaticMethod(java.lang.reflect.Method method)Description copied from interface:MutableMetaClassadds a new static method to this MetaClass. This is only possible as long as initialise was not called.- Specified by:
- addNewStaticMethodin interface- MutableMetaClass
- Overrides:
- addNewStaticMethodin class- DelegatingMetaClass
- Parameters:
- method- the method to be added
 
- 
addMetaMethodDescription copied from interface:MutableMetaClassAdds a new MetaMethod to the MetaClass- Specified by:
- addMetaMethodin interface- MutableMetaClass
- Overrides:
- addMetaMethodin class- DelegatingMetaClass
- Parameters:
- metaMethod- The MetaMethod to add
 
- 
addMetaBeanPropertyDescription copied from interface:MutableMetaClassAdds a new MetaBeanProperty to the MetaClass- Specified by:
- addMetaBeanPropertyin interface- MutableMetaClass
- Overrides:
- addMetaBeanPropertyin class- DelegatingMetaClass
- Parameters:
- metaBeanProperty- The MetaBeanProperty instance
 
- 
equalspublic boolean equals(java.lang.Object obj)- Overrides:
- equalsin class- DelegatingMetaClass
 
 
-