Joda System API

org.joda.property.impl.link
Class DefaultLinkListProperty

java.lang.Object
  |
  +--org.joda.property.impl.AbstractModelElement
        |
        +--org.joda.property.impl.AbstractProperty
              |
              +--org.joda.property.impl.collection.AbstractListProperty
                    |
                    +--org.joda.property.impl.link.DefaultLinkListProperty
All Implemented Interfaces:
java.util.Collection, CollectionProperty, InitializableProperty, LinkingProperty, LinkListProperty, java.util.List, ListProperty, ModelElement, Property, Property.Internal, java.io.Serializable

public class DefaultLinkListProperty
extends AbstractListProperty
implements LinkListProperty

Standard link list view implementation which links one Bean to a list of other Beans.

This view does not hold the beans, it simply provides convenient methods to manipulate the link. The method node() refers to the parent bean.

Author:
Stephen Colebourne
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Constructor Summary
DefaultLinkListProperty()
          Constructor
 
Method Summary
 Bean addNew()
          Create a new Bean of the correct type and add the underlying node to the end of the list.
 Bean addNew(java.lang.Class type)
          Create a new Bean of a specific type and add the underlying node to the end of the list.
 Bean addNew(int insertIndex)
          Create a new Bean of the correct type and insert the underlying node into the list.
 Bean addNew(int insertIndex, java.lang.Class type)
          Create a new Bean of a specific type and insert the underlying node into the list.
 void clear()
           
protected  java.lang.Object convertListObject(java.lang.Object object)
          Check whether the object is valid to add to the map.
protected  Bean createBean(java.lang.Class type)
          Create a new bean
protected  Property createClonedProperty(Bean bean)
          Create a clone of this property, ignoring the data contents
 Bean getBean(int index)
          Get the typecast Bean from the list by index
 java.util.List getBeanList()
          Get the beans being linked to as a list.
protected  java.util.List getInternal()
          Get the actual list
 void initPropertyCreated(PropertyInit init)
          Initialize the list, after the constructor
protected  void populateClonedProperty(IdentityBasedHashMap clonedObjects, Property property)
          Populate the clone of this property with the same data as this one
 java.lang.String toString()
          Get a debug string representing this object.
 
Methods inherited from class org.joda.property.impl.collection.AbstractListProperty
add, add, addAll, addAll, contains, containsAll, get, getContentName, getContentType, getPropertyType, indexOf, initBeanCreated, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, set, size, subList, toArray, toArray, toCollection, toList, toObject
 
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.ListProperty
toList
 
Methods inherited from interface org.joda.property.type.CollectionProperty
toCollection
 
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.Collection
add, addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Constructor Detail

DefaultLinkListProperty

public DefaultLinkListProperty()
Constructor

Method Detail

initPropertyCreated

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

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

getInternal

protected java.util.List getInternal()
Description copied from class: AbstractListProperty
Get the actual list

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

clear

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

convertListObject

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

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

getBean

public Bean getBean(int index)
Get the typecast Bean from the list by index

Specified by:
getBean in interface LinkListProperty
Parameters:
index - the index to retrieve
Returns:
bean by index

createBean

protected Bean createBean(java.lang.Class type)
Create a new bean


addNew

public Bean addNew()
Description copied from interface: LinkListProperty
Create a new Bean of the correct type and add the underlying node to the end of the list.

Specified by:
addNew in interface LinkListProperty
Returns:
the Bean that was created
See Also:
LinkListProperty.addNew()

addNew

public Bean addNew(java.lang.Class type)
Description copied from interface: LinkListProperty
Create a new Bean of a specific type and add the underlying node to the end of the list. The interface must be the same, or a subinterface of the type of the link's Bean type.

Specified by:
addNew in interface LinkListProperty
Parameters:
type - the interface to create a Bean for
Returns:
the Bean that was created
See Also:
LinkListProperty.addNew(Class)

addNew

public Bean addNew(int insertIndex)
Description copied from interface: LinkListProperty
Create a new Bean of the correct type and insert the underlying node into the list.

Specified by:
addNew in interface LinkListProperty
Returns:
the Bean that was created
See Also:
LinkListProperty.addNew(int)

addNew

public Bean addNew(int insertIndex,
                   java.lang.Class type)
Description copied from interface: LinkListProperty
Create a new Bean of a specific type and insert the underlying node into the list. The interface must be the same, or a subinterface of the type of the link's Bean type.

Specified by:
addNew in interface LinkListProperty
Parameters:
type - the interface to create a Bean for
Returns:
the Bean that was created
See Also:
LinkListProperty.addNew(int, 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 debug string representing this object.

Specified by:
toString in interface Property
Overrides:
toString in class AbstractListProperty
Returns:
debug string

Joda System API

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