Joda System API

org.joda.property.impl.link
Class DefaultLinkMapProperty

java.lang.Object
  |
  +--org.joda.property.impl.AbstractModelElement
        |
        +--org.joda.property.impl.AbstractProperty
              |
              +--org.joda.property.impl.collection.AbstractMapProperty
                    |
                    +--org.joda.property.impl.link.DefaultLinkMapProperty
All Implemented Interfaces:
InitializableProperty, LinkingProperty, LinkMapProperty, java.util.Map, MapProperty, ModelElement, Property, Property.Internal, java.io.Serializable

public class DefaultLinkMapProperty
extends AbstractMapProperty
implements LinkMapProperty

Standard implementation of a map of beans.

Author:
Stephen Colebourne
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.joda.property.impl.collection.AbstractMapProperty
AbstractMapProperty.Entry
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Constructor Summary
DefaultLinkMapProperty()
          Constructor
 
Method Summary
 void clear()
           
protected  java.lang.Object convertMapValueObject(java.lang.Object object)
          Check whether the object is valid to add to the map.
protected  Bean createBean(java.lang.Class intface)
          Create a new child ModelProperty given an interface.
protected  Property createClonedProperty(Bean bean)
          Create a clone of this property, ignoring the data contents
 Bean getBean(java.lang.Object key)
          Get the element at the specified key as a formal string
 java.util.List getBeanList()
          Get the beans being linked to as a list.
protected  java.util.Set getInternal()
          Get the set backing the map
 void initPropertyCreated(PropertyInit init)
          Initialize the map, after the constructor
protected  void populateClonedProperty(IdentityBasedHashMap clonedObjects, Property property)
          Populate the clone of this property with the same data as this one
 Bean putNew(java.lang.Object key)
          Get the list underlying the property.
 Bean putNew(java.lang.Object key, java.lang.Class type)
          Get the list underlying the property.
 java.lang.String toString()
          Get a debugging string of this object
 
Methods inherited from class org.joda.property.impl.collection.AbstractMapProperty
containsKey, containsValue, convertMapKeyObject, entrySet, get, getContentName, getContentType, getMapKeyType, getPropertyType, initBeanCreated, isEmpty, keySet, put, putAll, remove, set, size, toMap, toObject, values
 
Methods inherited from class org.joda.property.impl.AbstractProperty
addPropertyChangeListener, bean, checkArgumentNotNull, checkModifiable, checkValueNotNull, checkValueNotNull, cloneDeep, convertObject, data, equals, equalsValue, firePropertyChange, firePropertyChange, getPropertyName, getThis, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, setModifiable, setReadOnly, toDataString
 
Methods inherited from class org.joda.property.impl.AbstractModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.joda.property.type.MapProperty
getMapKeyType, toMap
 
Methods inherited from interface org.joda.property.Property
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getContentName, getContentType, getPropertyName, getPropertyType, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, set, setModifiable, setReadOnly, toObject
 
Methods inherited from interface org.joda.property.ModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

DefaultLinkMapProperty

public DefaultLinkMapProperty()
Constructor

Method Detail

initPropertyCreated

public void initPropertyCreated(PropertyInit init)
Initialize the map, after the constructor

Specified by:
initPropertyCreated in interface InitializableProperty
Overrides:
initPropertyCreated in class AbstractMapProperty

getInternal

protected java.util.Set getInternal()
Description copied from class: AbstractMapProperty
Get the set backing the map

Overrides:
getInternal in class AbstractMapProperty
See Also:
AbstractMapProperty.getInternal()

clear

public void clear()
Specified by:
clear in interface java.util.Map
Overrides:
clear in class AbstractMapProperty
See Also:
Map.clear()

convertMapValueObject

protected java.lang.Object convertMapValueObject(java.lang.Object object)
Check whether the object is valid to add to the map. This checks using the map value type.

Specified by:
convertMapValueObject in class AbstractMapProperty
Throws:
IllegalArgumentPropertyException - if the argument is unacceptable for adding to the map

getBean

public Bean getBean(java.lang.Object key)
Description copied from interface: LinkMapProperty
Get the element at the specified key as a formal string

Specified by:
getBean in interface LinkMapProperty
Parameters:
key - the element to obtain
Returns:
the element as a string
See Also:
LinkMapProperty.getBean(Object)

createBean

protected Bean createBean(java.lang.Class intface)
Create a new child ModelProperty given an interface.

Parameters:
intface - the interface to create
Returns:
the newly created ModelProperty

putNew

public Bean putNew(java.lang.Object key)
Description copied from interface: LinkMapProperty
Get the list underlying the property.

Specified by:
putNew in interface LinkMapProperty
Parameters:
key - the key to set the new bean at
Returns:
newly created bean
See Also:
LinkMapProperty.putNew(Object)

putNew

public Bean putNew(java.lang.Object key,
                   java.lang.Class type)
Description copied from interface: LinkMapProperty
Get the list underlying the property.

Specified by:
putNew in interface LinkMapProperty
Parameters:
key - the key to set the new bean at
type - the bean interface to create
Returns:
newly created bean
See Also:
LinkMapProperty.putNew(Object, Class)

getBeanList

public java.util.List getBeanList()
Description copied from interface: LinkingProperty
Get the beans being linked to as a list. The list will be an unmodifiable copy of the real list.

Specified by:
getBeanList in interface LinkingProperty
Returns:
the list of beans
See Also:
LinkingProperty.getBeanList()

createClonedProperty

protected Property createClonedProperty(Bean bean)
Create a clone of this property, ignoring the data contents

Overrides:
createClonedProperty in class AbstractProperty
Parameters:
bean - the bean that owns the property

populateClonedProperty

protected void populateClonedProperty(IdentityBasedHashMap clonedObjects,
                                      Property property)
Populate the clone of this property with the same data as this one

Overrides:
populateClonedProperty in class AbstractProperty
Parameters:
clonedObjects - the map of original element to cloned element
property - the property to clone the data into

toString

public java.lang.String toString()
Get a debugging string of this object

Specified by:
toString in interface Property
Overrides:
toString in class AbstractProperty
Returns:
debugging string

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.