groovy.lang
Interface GroovyObject
- All Known Subinterfaces:
- GroovyInterceptable, GroovyResultSet
- All Known Implementing Classes:
- ANSI.RenderMessageSource, AntBuilder, Attribute, Attributes, BaseMarkupBuilder, BaseMarkupBuilder.Document, BaseMarkupBuilder.Document.OutputSink, Binding, BindingProxy, BindPathSnooper, BooleanWrapper, Builder, Builder.Built, BuilderSupport, ByteWrapper, CallResultSet, CharWrapper, Closure, Closure.WritableClosure, CurriedClosure, DelegatingMetaClass, DOMBuilder, DoubleWrapper, Expando, ExpandoMetaClass, ExpandoMetaClass.DefiningClosure, ExpandoMetaClass.ExpandoMetaConstructor, ExpandoMetaClass.ExpandoMetaProperty, ExpandoMetaClass.StaticDefiningClosure, ExpandoMetaClass.SubClassDefiningClosure, FactoryBuilderSupport, FactoryInterceptorMetaClass, FilteredAttributes, FilteredNodeChildren, FloatWrapper, GPathResult, GroovyLog, GroovyMBean, GroovyObjectSupport, GroovyObjectWrapper, GroovyResultSetExtension, GroovyRowResult, GroovyShell, GString, GStringImpl, HandleMetaClass, IntWrapper, IteratorClosureAdapter, LongWrapper, MarkupBuilder, MessageSource, MethodClosure, MixedInMetaClass, NamespaceBuilderSupport, NoChildren, NodeBuilder, NodeChild, NodeChildren, NonEmptySequence, NullObject, ObjectGraphBuilder, OwnedMetaClass, PojoWrapper, Proxy, Reference, SAXBuilder, Script, ScriptReference, Sequence, ServletBinding, ShortWrapper, Wrapper
public interface GroovyObject
The interface implemented by all Groovy objects.
Especially handy for using Groovy objects when in the Java world.
- Version:
- $Revision: 9880 $
- Author:
- James Strachan
Method Summary |
MetaClass |
getMetaClass()
Returns the metaclass for a given class. |
java.lang.Object |
getProperty(java.lang.String propertyName)
Retrieves a property value. |
java.lang.Object |
invokeMethod(java.lang.String name,
java.lang.Object args)
Invokes the given method. |
void |
setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation. |
void |
setProperty(java.lang.String propertyName,
java.lang.Object newValue)
Sets the given property to the new value. |
invokeMethod
java.lang.Object invokeMethod(java.lang.String name,
java.lang.Object args)
- Invokes the given method.
- 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
java.lang.Object getProperty(java.lang.String propertyName)
- Retrieves a property value.
- Parameters:
propertyName
- the name of the property of interest
- Returns:
- the given property
setProperty
void setProperty(java.lang.String propertyName,
java.lang.Object newValue)
- Sets the given property to the new value.
- Parameters:
propertyName
- the name of the property of interestnewValue
- the new value for the property
getMetaClass
MetaClass getMetaClass()
- Returns the metaclass for a given class.
- Returns:
- the metaClass of this instance
setMetaClass
void setMetaClass(MetaClass metaClass)
- Allows the MetaClass to be replaced with a derived implementation.
- Parameters:
metaClass
- the new metaclass
Copyright © ${year} The Codehaus. All Rights Reserved.