public class GroovyObjectWrapper extends Wrapper
Modifier and Type | Field and Description |
---|---|
protected GroovyObject |
wrapped |
constrainedType
Constructor and Description |
---|
GroovyObjectWrapper(GroovyObject wrapped,
Class constrainedType) |
Modifier and Type | Method and Description |
---|---|
protected MetaClass |
getDelegatedMetaClass() |
Object |
getProperty(String property)
Retrieves a property value.
|
protected Object |
getWrapped() |
Object |
invokeMethod(String name,
Object args)
Invokes the given method.
|
void |
setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation.
|
void |
setProperty(String property,
Object newValue)
Sets the given property to the new value.
|
Object |
unwrap() |
getMetaClass, getType
protected final GroovyObject wrapped
public GroovyObjectWrapper(GroovyObject wrapped, Class constrainedType)
public Object getProperty(String property)
GroovyObject
property
- the name of the property of interestpublic Object invokeMethod(String name, Object args)
GroovyObject
name
- the name of the method to callargs
- the arguments to use for the method callpublic void setMetaClass(MetaClass metaClass)
GroovyObject
metaClass
- the new metaclasspublic void setProperty(String property, Object newValue)
GroovyObject
property
- the name of the property of interestnewValue
- the new value for the propertyprotected Object getWrapped()
getWrapped
in class Wrapper
protected MetaClass getDelegatedMetaClass()
getDelegatedMetaClass
in class Wrapper