Top Description Methods
groovy.lang

public Interface GroovyObject

Known Direct Subinterfaces
groovy.lang.GroovyInterceptable
Known Direct Implementers
groovy.lang.GroovyObjectSupport, groovy.lang.Sequence, org.codehaus.groovy.runtime.wrappers.Wrapper, groovy.lang.DelegatingMetaClass, groovy.lang.ExpandoMetaClass
Imports
groovy.transform.Internal

The interface implemented by all Groovy objects.

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

Method Summary

Modifier and TypeMethod and Description
public MetaClass

Returns:

the metaClass of this instance
getMetaClass
()

Returns the metaclass for a given class.

public default Object

Returns:

the given property
getProperty
(String
the name of the property of interest
propertyName
)

Retrieves a property value.

public default Object

Returns:

the result of invoking the method
invokeMethod
(String
the name of the method to call
name
,
Object
the arguments to use for the method call
args
)

Invokes the given method.

public void
setMetaClass(MetaClass
the new metaclass
metaClass
)

Allows the MetaClass to be replaced with a derived implementation.

public default void
setProperty(String
the name of the property of interest
propertyName
,
Object
the new value for the property
newValue
)

Sets the given property to the new value.

Method Detail

getMetaClassback to summary
public MetaClass getMetaClass()

Returns the metaclass for a given class.

Returns:MetaClass

the metaClass of this instance

getPropertyback to summary
public default Object getProperty(String propertyName)

Retrieves a property value.

Parameters
propertyName:String

the name of the property of interest

Returns:Object

the given property

Annotations
@Internal
invokeMethodback to summary
public default Object invokeMethod(String name, Object args)

Invokes the given method.

Parameters
name:String

the name of the method to call

args:Object

the arguments to use for the method call

Returns:Object

the result of invoking the method

Annotations
@Internal
setMetaClassback to summary
public void setMetaClass(MetaClass metaClass)

Allows the MetaClass to be replaced with a derived implementation.

Parameters
metaClass:MetaClass

the new metaclass

setPropertyback to summary
public default void setProperty(String propertyName, Object newValue)

Sets the given property to the new value.

Parameters
propertyName:String

the name of the property of interest

newValue:Object

the new value for the property

Annotations
@Internal