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
-
Field Summary
Fields inherited from class groovy.lang.DelegatingMetaClass
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetaBeanProperty(MetaBeanProperty metaBeanProperty) Adds a new MetaBeanProperty to the MetaClassvoidaddMetaMethod(MetaMethod metaMethod) Adds a new MetaMethod to the MetaClassvoidaddNewInstanceMethod(Method method) adds a new instance method to this MetaClass.voidaddNewStaticMethod(Method method) adds a new static method to this MetaClass.booleangetProperty(String property) Retrieves a property value.voidComplete the initialisation process.invokeMethod(String name, Object args) Invokes the given method.voidsetProperty(String property, Object newValue) Sets the given property to the new value.Methods inherited from class groovy.lang.DelegatingMetaClass
getAdaptee, 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, toString
-
Constructor Details
-
HandleMetaClass
-
HandleMetaClass
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:MetaClassComplete the initialisation process. After this method is called no methods should be added to the metaclass. 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 interfaceMetaClass- Overrides:
initializein classDelegatingMetaClass
-
replaceDelegate
-
invokeMethod
Description copied from interface:GroovyObjectInvokes the given method.- Specified by:
invokeMethodin interfaceGroovyObject- Overrides:
invokeMethodin classDelegatingMetaClass- Parameters:
name- the name of the method to callargs- the arguments to use for the method call- Returns:
- the result of invoking the method
-
getProperty
Description copied from interface:GroovyObjectRetrieves a property value.- Specified by:
getPropertyin interfaceGroovyObject- Overrides:
getPropertyin classDelegatingMetaClass- Parameters:
property- the name of the property of interest- Returns:
- the given property
-
setProperty
Description copied from interface:GroovyObjectSets the given property to the new value.- Specified by:
setPropertyin interfaceGroovyObject- Overrides:
setPropertyin classDelegatingMetaClass- Parameters:
property- the name of the property of interestnewValue- the new value for the property
-
addNewInstanceMethod
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 interfaceMutableMetaClass- Overrides:
addNewInstanceMethodin classDelegatingMetaClass- Parameters:
method- the method to be added
-
addNewStaticMethod
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 interfaceMutableMetaClass- Overrides:
addNewStaticMethodin classDelegatingMetaClass- Parameters:
method- the method to be added
-
addMetaMethod
Description copied from interface:MutableMetaClassAdds a new MetaMethod to the MetaClass- Specified by:
addMetaMethodin interfaceMutableMetaClass- Overrides:
addMetaMethodin classDelegatingMetaClass- Parameters:
metaMethod- The MetaMethod to add
-
addMetaBeanProperty
Description copied from interface:MutableMetaClassAdds a new MetaBeanProperty to the MetaClass- Specified by:
addMetaBeanPropertyin interfaceMutableMetaClass- Overrides:
addMetaBeanPropertyin classDelegatingMetaClass- Parameters:
metaBeanProperty- The MetaBeanProperty instance
-
equals
- Overrides:
equalsin classDelegatingMetaClass
-