org.deduced.dynamic
Class DynamicPropertyList

java.lang.Object
  extended by org.deduced.AbstractPropertyCollection<K,V>
      extended by org.deduced.PropertyMap<java.lang.Object,V>
          extended by org.deduced.IdPropertyMap<V>
              extended by org.deduced.PropertyList<PropertyCollection<?,?>>
                  extended by org.deduced.dynamic.DynamicPropertyList
All Implemented Interfaces:
java.lang.Cloneable, PropertyCollection<java.lang.Object,PropertyCollection<?,?>>

public class DynamicPropertyList
extends PropertyList<PropertyCollection<?,?>>

Class used to host a list of DynamicPropertyMap. The difference between this list and another implementation is that this list will actually propagate the changes to it's structure to it's parent in the hierarchy. This will allow the parents to override the required properties on the child objects.

Author:
Steve McDuff

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deduced.PropertyMap
PropertyMap.PropertyIterator, PropertyMap.ValueIterator
 
Nested classes/interfaces inherited from class org.deduced.AbstractPropertyCollection
AbstractPropertyCollection.CollectionToDeleteMonitor
 
Field Summary
private static long serialVersionUID
          serial ID
private  PropertyCollection<?,?> type
          type of the list
 
Fields inherited from class org.deduced.PropertyList
PROPERTY_LIST_TYPE
 
Fields inherited from class org.deduced.PropertyMap
PROPERTY_MAP_TYPE
 
Fields inherited from class org.deduced.AbstractPropertyCollection
CHECK_DELETE_MODE_AUTOMATIC, CHECK_DELETE_MODE_MANUAL, COLLECTION_TO_DELETE
 
Fields inherited from interface org.deduced.PropertyCollection
PROPERTY_COLLECTION_TYPE
 
Constructor Summary
DynamicPropertyList()
          constructor for the property list
DynamicPropertyList(PropertyCollection<?,?> setFixedInstance, PropertyCollection<?,?> setType)
          constructor for the property list
 
Method Summary
 void activate()
          (non-Javadoc)
protected  void activateOwnedChildCollections()
          activate all Owned Child Collections
 java.lang.Object addProperty(java.lang.Object key, PropertyCollection<?,?> instance, PropertyCollection<?,?> value)
          (non-JSDoc)
protected  boolean clearValueParentIfNecessaryReturnIsReference(PropertyCollection<?,?> value)
          clear the Parent field of the value if the parent is the local object
protected  java.lang.Object internalAddProperty(java.lang.Object propertyKey, Property<PropertyCollection<?,?>> resultAdd)
          (non-Javadoc)
 Property<PropertyCollection<?,?>> removeProperty(java.lang.Object propertyKey)
          (non-Javadoc)
 PropertyCollection<?,?> setProperty(java.lang.Object propertyKey, PropertyCollection<?,?> value)
          (non-JSDoc)
 PropertyCollection<?,?> type()
          (non-JSDoc)
 
Methods inherited from class org.deduced.IdPropertyMap
areKeysAssignedAutomatically, createThrowMustNotSpecifyKeyError, equals, generateKey, hashCode, instanceKey, removePropertyInstance
 
Methods inherited from class org.deduced.PropertyMap
asKeySet, cleanNewlyClonedValue, clone, containsKey, getFixedInstance, getProperty, getPropertyValue, handleRemovedProperty, internalIsSetValueParentNecessary, internalRemoveProperty, internalSetValueParentIfNecessary, isFixedInstanceReference, iterator, iteratorByValue, putPropertyInMap, removePropertyValue, resetRemovedPropertyParent, setFixedInstance, size, validateCollectionParentBeforeAddition
 
Methods inherited from class org.deduced.AbstractPropertyCollection
addListener, asPropertyList, asPropertyMap, asValueList, asValueMap, callObjectClone, classLogger, clear, clearCollectionMonitoredForDelete, cloneCollection, containsInstance, containsValue, createUniqueID, delete, deleteClearAllProperties, deleteClearListenerList, deleteFireDeleteEvent, deleteProcessCompletedValidation, deleteRemoveLocalObjectFromParent, deleteValidateEmptyListenerList, deleteValidateNoPendingReferences, firePropertyChangeEvent, flushCollectionsWithNewParent, flushCollectionsWithNewParent, getActionInvoker, getCheckDeleteMode, getCheckDeleteRunner, getInstanceIdentityKey, id, internalFirePropertyChangeEvent, invokeAction, isActivated, isDeleteCheckedOnClearParent, isEmpty, isListenerRegistered, isParentOrKeyNull, keyOnParent, parent, removeListener, requiresChangeEvent, setActionInvoker, setCheckDeleteMode, setCheckDeleteRunner, setDeleteCheckedOnClearParent, setParent, toString, updateReference, updateReferenceWithReferenceFlag, validateAllPropertyInstances, validateNoListener, validateNoParentRecursion, validateParentIsNull, validateParentIsNull, valueKey
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serial ID

See Also:
Constant Field Values

type

private final PropertyCollection<?,?> type
type of the list

Constructor Detail

DynamicPropertyList

public DynamicPropertyList()
constructor for the property list


DynamicPropertyList

public DynamicPropertyList(PropertyCollection<?,?> setFixedInstance,
                           PropertyCollection<?,?> setType)
constructor for the property list

Parameters:
setFixedInstance - the fixed instances in the list
setType - type of the dynamic list
Method Detail

activate

public void activate()
(non-Javadoc)

Specified by:
activate in interface PropertyCollection<java.lang.Object,PropertyCollection<?,?>>
Overrides:
activate in class AbstractPropertyCollection<java.lang.Object,PropertyCollection<?,?>>
See Also:
AbstractPropertyCollection.activate()

activateOwnedChildCollections

protected void activateOwnedChildCollections()
activate all Owned Child Collections


addProperty

public java.lang.Object addProperty(java.lang.Object key,
                                    PropertyCollection<?,?> instance,
                                    PropertyCollection<?,?> value)
(non-JSDoc)

Specified by:
addProperty in interface PropertyCollection<java.lang.Object,PropertyCollection<?,?>>
Overrides:
addProperty in class IdPropertyMap<PropertyCollection<?,?>>
Parameters:
key - the key of the property. Some collections assign keys automatically, for those collections, a null value is expected. If the key is specified when they are assigned automatically, an IllegalArgumentException will be thrown
instance - the property instance to add. Most collections assign the instance automatically, for those collections, the instance can either be null or be the same as the instance that is automatically assigned, otherwise an error will be thrown
value - the property value. If the value is a property collection, then the collection is expected to have a null parent if the instance is owned (not by reference), otherwise an IllegalArgumentException will be thrown
Returns:
the added property key
See Also:
IdPropertyMap.addProperty(java.lang.Object, org.deduced.PropertyCollection, java.lang.Object)

setProperty

public PropertyCollection<?,?> setProperty(java.lang.Object propertyKey,
                                           PropertyCollection<?,?> value)
(non-JSDoc)

Specified by:
setProperty in interface PropertyCollection<java.lang.Object,PropertyCollection<?,?>>
Overrides:
setProperty in class PropertyMap<java.lang.Object,PropertyCollection<?,?>>
Parameters:
propertyKey - the key of the property
value - the new value of the property. If the property is a collection that is not by reference, this method requires that the passed collection has a parent set to null since it will reset the parent.
Returns:
the added value instance
See Also:
PropertyMap.setProperty(java.lang.Object, java.lang.Object)

type

public PropertyCollection<?,?> type()
(non-JSDoc)

Specified by:
type in interface PropertyCollection<java.lang.Object,PropertyCollection<?,?>>
Overrides:
type in class PropertyList<PropertyCollection<?,?>>
Returns:
the property description
See Also:
PropertyList.type()

internalAddProperty

protected java.lang.Object internalAddProperty(java.lang.Object propertyKey,
                                               Property<PropertyCollection<?,?>> resultAdd)
(non-Javadoc)

Overrides:
internalAddProperty in class PropertyMap<java.lang.Object,PropertyCollection<?,?>>
Parameters:
propertyKey - the key of the added property
resultAdd - the property to add to the map
Returns:
the added property value
See Also:
PropertyMap.internalAddProperty(java.lang.Object, org.deduced.Property)

removeProperty

public Property<PropertyCollection<?,?>> removeProperty(java.lang.Object propertyKey)
(non-Javadoc)

Specified by:
removeProperty in interface PropertyCollection<java.lang.Object,PropertyCollection<?,?>>
Overrides:
removeProperty in class PropertyMap<java.lang.Object,PropertyCollection<?,?>>
Parameters:
propertyKey - the key of the property
Returns:
the removed property, null if remove failed
See Also:
PropertyMap.removeProperty(java.lang.Object)

clearValueParentIfNecessaryReturnIsReference

protected boolean clearValueParentIfNecessaryReturnIsReference(PropertyCollection<?,?> value)
clear the Parent field of the value if the parent is the local object

Parameters:
value - the value on which to clear the parent
Returns:
true if the value was by reference. False otherwise.