Top Description Fields Constructors Methods
groovy.util

public Class Expando

extends GroovyObjectSupport
Class Inheritance
Imports
groovy.lang.Closure, .GroovyObjectSupport, .GroovyRuntimeException, .MetaExpandoProperty, .MissingPropertyException, java.util.ArrayList, .HashMap, .List, .Map, .Map.Entry

Represents a dynamically expandable bean.

Field Summary

Modifier and TypeField and Description
private Map<K, V>

Constructor Summary

AccessConstructor and Description
public
public
Expando(Map<K, V> expandoProperties)

Method Summary

Modifier and TypeMethod and Description
protected Map<K, V>

Returns:

a newly created Map implementation
createMap
()

Factory method to create a new Map used to store the expando properties map

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

This allows equals to be overridden by a closure field method attached to the expando object.
public List<E>
public Map<K, V>

Returns:

the dynamically expanded properties
getProperties
()

public Object
getProperty(String
the name of the property of interest
property
)

Overrides default groovy.lang.GroovyObject.getProperty.

Retrieves a property value.
public int
hashCode()

Overrides java.lang.Object.hashCode.

This allows hashCode to be overridden by a closure field method attached to the expando object.
public Object
invokeMethod(String
the name of the method to call
name
,
Object
the arguments to use for the method call
args
)

Overrides default groovy.lang.GroovyObject.invokeMethod.

Invokes the given method.
public void
setProperty(String
the name of the property of interest
property
,
Object
the new value for the property
newValue
)

Overrides default groovy.lang.GroovyObject.setProperty.

Sets the given property to the new value.
public String
toString()

Overrides java.lang.Object.toString.

This allows toString to be overridden by a closure field method attached to the expando object.
Inherited from groovy.lang.GroovyObjectSupport:
getMetaClasssetMetaClass

Field Detail

expandoPropertiesback to summary
private Map<K, V> expandoProperties

Constructor Detail

Expandoback to summary
public Expando()
Expandoback to summary
public Expando(Map<K, V> expandoProperties)

Method Detail

createMapback to summary
protected Map<K, V> createMap()

Factory method to create a new Map used to store the expando properties map

Returns:Map<K, V>

a newly created Map implementation

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

This allows equals to be overridden by a closure field method attached to the expando object.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

See Also
java.lang.Object#equals(java.lang.Object)
getMetaPropertyValuesback to summary
public List<E> getMetaPropertyValues()
getPropertiesback to summary
public Map<K, V> getProperties()
Returns:Map<K, V>

the dynamically expanded properties

getPropertyback to summary
public Object getProperty(String property)

Overrides default groovy.lang.GroovyObject.getProperty.

Doc from groovy.lang.GroovyObject.getProperty.

Retrieves a property value.

Parameters
property:String

the name of the property of interest

Returns:Object

the given property

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

This allows hashCode to be overridden by a closure field method attached to the expando object.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

See Also
java.lang.Object#hashCode()
invokeMethodback to summary
public Object invokeMethod(String name, Object args)

Overrides default groovy.lang.GroovyObject.invokeMethod.

Doc from groovy.lang.GroovyObject.invokeMethod.

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

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

Overrides default groovy.lang.GroovyObject.setProperty.

Doc from groovy.lang.GroovyObject.setProperty.

Sets the given property to the new value.

Parameters
property:String

the name of the property of interest

newValue:Object

the new value for the property

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

This allows toString to be overridden by a closure field method attached to the expando object.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

See Also
java.lang.Object#toString()