Package groovy.util
Class Expando
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.Expando
- All Implemented Interfaces:
GroovyObject
Represents a dynamically expandable bean.
- Author:
- James Strachan, Hein Meling, Pilho Kim
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Map
Factory method to create a new Map used to store the expando properties mapboolean
This allows equals to be overridden by a closure field method attached to the expando object.getProperty
(String property) Retrieves a property value.int
hashCode()
This allows hashCode to be overridden by a closure field method attached to the expando object.invokeMethod
(String name, Object args) Invokes the given method.void
setProperty
(String property, Object newValue) Sets the given property to the new value.toString()
This allows toString to be overridden by a closure field method attached to the expando object.Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
-
Constructor Details
-
Expando
public Expando() -
Expando
-
-
Method Details
-
getProperties
- Returns:
- the dynamically expanded properties
-
getMetaPropertyValues
-
getProperty
Description copied from interface:GroovyObject
Retrieves a property value.- Specified by:
getProperty
in interfaceGroovyObject
- Overrides:
getProperty
in classGroovyObjectSupport
- Parameters:
property
- the name of the property of interest- Returns:
- the given property
-
setProperty
Description copied from interface:GroovyObject
Sets the given property to the new value.- Specified by:
setProperty
in interfaceGroovyObject
- Overrides:
setProperty
in classGroovyObjectSupport
- Parameters:
property
- the name of the property of interestnewValue
- the new value for the property
-
invokeMethod
Description copied from interface:GroovyObject
Invokes the given method.- Specified by:
invokeMethod
in interfaceGroovyObject
- Overrides:
invokeMethod
in classGroovyObjectSupport
- Parameters:
name
- the name of the method to callargs
- the arguments to use for the method call- Returns:
- the result of invoking the method
-
toString
This allows toString to be overridden by a closure field method attached to the expando object. -
equals
This allows equals to be overridden by a closure field method attached to the expando object. -
hashCode
public int hashCode()This allows hashCode to be overridden by a closure field method attached to the expando object. -
createMap
Factory method to create a new Map used to store the expando properties map- Returns:
- a newly created Map implementation
-