public class HandleMetaClass extends DelegatingMetaClass
delegate
Constructor and Description |
---|
HandleMetaClass(MetaClass mc) |
HandleMetaClass(MetaClass mc,
Object obj) |
Modifier and Type | Method and Description |
---|---|
void |
addMetaBeanProperty(MetaBeanProperty metaBeanProperty)
Adds a new MetaBeanProperty to the MetaClass
|
void |
addMetaMethod(MetaMethod metaMethod)
Adds a new MetaMethod to the MetaClass
|
void |
addNewInstanceMethod(Method method)
adds a new instance method to this MetaClass.
|
void |
addNewStaticMethod(Method method)
adds a new static method to this MetaClass.
|
boolean |
equals(Object obj) |
Object |
getProperty(String property)
Retrieves a property value.
|
void |
initialize()
Complete the initialisation process.
|
Object |
invokeMethod(String name,
Object args)
Invokes the given method.
|
GroovyObject |
replaceDelegate() |
void |
setProperty(String property,
Object newValue)
Sets the given property to the new value.
|
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
public HandleMetaClass(MetaClass mc)
public void initialize()
MetaClass
initialize
in interface MetaClass
initialize
in class DelegatingMetaClass
public GroovyObject replaceDelegate()
public Object invokeMethod(String name, Object args)
GroovyObject
invokeMethod
in interface GroovyObject
invokeMethod
in class DelegatingMetaClass
name
- the name of the method to callargs
- the arguments to use for the method callpublic Object getProperty(String property)
GroovyObject
getProperty
in interface GroovyObject
getProperty
in class DelegatingMetaClass
property
- the name of the property of interestpublic void setProperty(String property, Object newValue)
GroovyObject
setProperty
in interface GroovyObject
setProperty
in class DelegatingMetaClass
property
- the name of the property of interestnewValue
- the new value for the propertypublic void addNewInstanceMethod(Method method)
MutableMetaClass
addNewInstanceMethod
in interface MutableMetaClass
addNewInstanceMethod
in class DelegatingMetaClass
method
- the method to be addedpublic void addNewStaticMethod(Method method)
MutableMetaClass
addNewStaticMethod
in interface MutableMetaClass
addNewStaticMethod
in class DelegatingMetaClass
method
- the method to be addedpublic void addMetaMethod(MetaMethod metaMethod)
MutableMetaClass
addMetaMethod
in interface MutableMetaClass
addMetaMethod
in class DelegatingMetaClass
metaMethod
- The MetaMethod to addpublic void addMetaBeanProperty(MetaBeanProperty metaBeanProperty)
MutableMetaClass
addMetaBeanProperty
in interface MutableMetaClass
addMetaBeanProperty
in class DelegatingMetaClass
metaBeanProperty
- The MetaBeanProperty instancepublic boolean equals(Object obj)
equals
in class DelegatingMetaClass