Groovy 1.7.0

groovy.lang
Interface GroovyObject


interface GroovyObject

The interface implemented by all Groovy objects.

Especially handy for using Groovy objects when in the Java world.

author:
James Strachan
version:
$Revision: 9880 $


Method Summary
MetaClass getMetaClass()

Returns the metaclass for a given class.

Object getProperty(String propertyName)

Retrieves a property value.

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 propertyName, Object newValue)

Sets the given property to the new value.

 

Method Detail

getMetaClass

public MetaClass getMetaClass()
Returns the metaclass for a given class.
return:
the metaClass of this instance


getProperty

public Object getProperty(String propertyName)
Retrieves a property value.
param:
propertyName the name of the property of interest
return:
the given property


invokeMethod

public Object invokeMethod(String name, Object args)
Invokes the given method.
param:
name the name of the method to call
param:
args the arguments to use for the method call
return:
the result of invoking the method


setMetaClass

public void setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation.
param:
metaClass the new metaclass


setProperty

public void setProperty(String propertyName, Object newValue)
Sets the given property to the new value.
param:
propertyName the name of the property of interest
param:
newValue the new value for the property


 

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