org.deduced.dynamic
Class FlyWheelDynamicPropertyCollectionController

java.lang.Object
  extended by org.deduced.AbstractPropertyCollection<K,V>
      extended by org.deduced.PropertyMap<java.lang.Object,java.lang.Object>
          extended by org.deduced.dynamic.DynamicPropertyMap
              extended by org.deduced.dynamic.FlyWheelDynamicPropertyCollectionController
All Implemented Interfaces:
java.lang.Cloneable, PropertyCollectionController, PropertyCollectionControllerModel, ContextualPropertyCollection<java.lang.Object,java.lang.Object>, NamedPropertyCollection, PropertyCollection<java.lang.Object,java.lang.Object>

public class FlyWheelDynamicPropertyCollectionController
extends DynamicPropertyMap
implements PropertyCollectionController

Fly Wheel Dynamic Property Collection Controller

Author:
Steve McDuff

Nested Class Summary
 class FlyWheelDynamicPropertyCollectionController.ChildCollectionControllerListPropertyImplementation
          Child Collection Controller List Property Implementation.
 class FlyWheelDynamicPropertyCollectionController.ChildPropertyControllerListPropertyImplementation
          Child Property Controller List Property Implementation.
 
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  DeducedControllerLayerExtension controlLayer
          control layer being used
private  boolean deleted
          is this collection deleted
private  boolean initialized
          is this collection initialized
private static long serialVersionUID
          serial ID
 
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.controller.PropertyCollectionControllerModel
CHILD_COLLECTION_CONTROLLER_LIST_INSTANCE, CHILD_PROPERTY_CONTROLLER_LIST_INSTANCE, CONTROLLED_COLLECTION_INSTANCE, IS_ADD_AVAILABLE_INSTANCE, IS_DELETE_AVAILABLE_INSTANCE, PROPERTY_COLLECTION_CONTROLLER_MODEL_TYPE
 
Fields inherited from interface org.deduced.NamedPropertyCollection
NAME_INSTANCE, NAMED_PROPERTY_COLLECTION_TYPE
 
Fields inherited from interface org.deduced.PropertyCollection
PROPERTY_COLLECTION_TYPE
 
Constructor Summary
FlyWheelDynamicPropertyCollectionController(PropertyCollection<?,?> setType, boolean setActivated, RuleExecutionContext setContext, DeducedControllerLayerExtension setControlLayer)
          FlyWheelDynamicPropertyCollectionController Constructor
 
Method Summary
protected  void activateOwnedChildCollections()
          (non-JSDoc)
static void activateOwnedChildCollectionsSkipLists(PropertyCollection<?,?> collectionToActivate)
          activate all Owned Child Collections, skip the lists of child controllers
 Task addPropertyToControlledCollection(java.lang.Object propertyKey, PropertyCollection<?,?> instance, java.lang.Object propertyValue)
          (non-Javadoc)
 Task createAndAddProperty(java.lang.Object key, PropertyCollection<?,?> instance, PropertyCollection<?,?> createType)
          (non-Javadoc)
 Task deleteControlledCollection()
          (non-Javadoc)
protected  void deleteRemoveLocalObjectFromParent()
          (non-Javadoc)
 PropertyList getChildCollectionControllerList()
          (non-Javadoc)
 PropertyList<PropertyControllerModel> getChildPropertyControllerList()
          (non-Javadoc)
 DeducedControllerLayerExtension getControlLayer()
           
 PropertyCollection getControlledCollection()
          (non-Javadoc)
 java.lang.String getName()
          (non-JSDoc)
 Property<java.lang.Object> getProperty(java.lang.Object propertyKey)
          (non-Javadoc)
 java.lang.Object getPropertyValue(java.lang.Object propertyKey)
          (non-Javadoc)
 boolean isAddAvailable()
          (non-Javadoc)
 boolean isAddValueValid(PropertyCollection<?,?> instance, PropertyCollection<?,?> value, boolean validateParent)
          (non-Javadoc)
 boolean isDeleteAvailable()
          (non-Javadoc)
 java.lang.Object keyOnParent()
          (non-Javadoc)
 PropertyCollection<?,?> parent()
          (non-Javadoc)
 PropertyList setChildCollectionControllerList(PropertyList newValue)
          (non-Javadoc)
 PropertyList setChildPropertyControllerList(PropertyList newValue)
          (non-Javadoc)
 PropertyCollection setControlledCollection(PropertyCollection setControlledCollection)
          (non-Javadoc)
 boolean setIsAddAvailable(boolean setIsAddAvailable)
          (non-Javadoc)
 boolean setIsDeleteAvailable(boolean setIsDeleteAvailable)
          (non-Javadoc)
 java.lang.String setName(java.lang.String newValue)
          (non-JSDoc)
 java.lang.Object setProperty(java.lang.Object propertyKey, java.lang.Object value)
          (non-Javadoc)
 
Methods inherited from class org.deduced.dynamic.DynamicPropertyMap
activate, activateOwnedChildCollections, addDeductionRule, attemptToCreateValue, cleanNewlyClonedValue, clone, createObjectIfBasicType, delete, deleteProperty, deletePropertyInstance, getContext, getOutputDepth, getRecursiveParentList, getRuleName, getRuleProperty, getTypeName, internalAddProperty, isActivated, isRuleApplicableToChild, isRulePropertyCreated, rebuildProperties, rebuildProperty, recursivelyOverrideChildProperties, removeDeductionRule, removeProperty, removePropertyInstance, ruleOutputMatchesReverseInstanceList, setParent, type, wasThePropertyReference
 
Methods inherited from class org.deduced.PropertyMap
addProperty, areKeysAssignedAutomatically, asKeySet, containsKey, getFixedInstance, 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, deleteClearAllProperties, deleteClearListenerList, deleteFireDeleteEvent, deleteProcessCompletedValidation, deleteValidateEmptyListenerList, deleteValidateNoPendingReferences, equals, firePropertyChangeEvent, flushCollectionsWithNewParent, flushCollectionsWithNewParent, getActionInvoker, getCheckDeleteMode, getCheckDeleteRunner, getInstanceIdentityKey, hashCode, id, instanceKey, internalFirePropertyChangeEvent, invokeAction, isDeleteCheckedOnClearParent, isEmpty, isListenerRegistered, isParentOrKeyNull, removeListener, requiresChangeEvent, setActionInvoker, setCheckDeleteMode, setCheckDeleteRunner, setDeleteCheckedOnClearParent, toString, updateReference, updateReferenceWithReferenceFlag, validateAllPropertyInstances, validateNoListener, validateNoParentRecursion, validateParentIsNull, validateParentIsNull, valueKey
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deduced.PropertyCollection
activate, addListener, addProperty, areKeysAssignedAutomatically, asKeySet, asPropertyList, asPropertyMap, asValueList, asValueMap, clear, clone, containsInstance, containsKey, containsValue, delete, getFixedInstance, id, instanceKey, invokeAction, isActivated, isEmpty, isListenerRegistered, iterator, iteratorByValue, removeListener, removeProperty, removePropertyInstance, removePropertyValue, setFixedInstance, setParent, size, type, valueKey
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serial ID

See Also:
Constant Field Values

controlLayer

private DeducedControllerLayerExtension controlLayer
control layer being used


deleted

private boolean deleted
is this collection deleted


initialized

private boolean initialized
is this collection initialized

Constructor Detail

FlyWheelDynamicPropertyCollectionController

public FlyWheelDynamicPropertyCollectionController(PropertyCollection<?,?> setType,
                                                   boolean setActivated,
                                                   RuleExecutionContext setContext,
                                                   DeducedControllerLayerExtension setControlLayer)
FlyWheelDynamicPropertyCollectionController Constructor

Parameters:
setType - the type of the current collection
setActivated - option to activate the current collection
setContext - the rule execution context
setControlLayer - the control layer to use
Method Detail

activateOwnedChildCollections

protected void activateOwnedChildCollections()
(non-JSDoc)

Overrides:
activateOwnedChildCollections in class DynamicPropertyMap
See Also:
DynamicPropertyMap.activateOwnedChildCollections()

activateOwnedChildCollectionsSkipLists

public static void activateOwnedChildCollectionsSkipLists(PropertyCollection<?,?> collectionToActivate)
activate all Owned Child Collections, skip the lists of child controllers

Parameters:
collectionToActivate - the collection to activate

addPropertyToControlledCollection

public Task addPropertyToControlledCollection(java.lang.Object propertyKey,
                                              PropertyCollection<?,?> instance,
                                              java.lang.Object propertyValue)
(non-Javadoc)

Specified by:
addPropertyToControlledCollection in interface PropertyCollectionController
Parameters:
propertyKey - the property key
instance - the property instance
propertyValue - the property value
Returns:
a task used to monitor the creation process. If the task is successful, the added property key will be set as the result of the task.
See Also:
PropertyCollectionController.addPropertyToControlledCollection(java.lang.Object, org.deduced.PropertyCollection, java.lang.Object)

getControlLayer

public DeducedControllerLayerExtension getControlLayer()
Returns:
the control layer

createAndAddProperty

public Task createAndAddProperty(java.lang.Object key,
                                 PropertyCollection<?,?> instance,
                                 PropertyCollection<?,?> createType)
(non-Javadoc)

Specified by:
createAndAddProperty in interface PropertyCollectionController
Parameters:
key - the key of the created type
instance - the instance of the created type
createType - the type of object to create
Returns:
a task used to monitor the creation process. If the task is successful, the added property key will be set as the result of the task.
See Also:
PropertyCollectionController.createAndAddProperty(java.lang.Object, org.deduced.PropertyCollection, org.deduced.PropertyCollection)

deleteControlledCollection

public Task deleteControlledCollection()
(non-Javadoc)

Specified by:
deleteControlledCollection in interface PropertyCollectionController
Returns:
the task monitoring the delete operation
See Also:
PropertyCollectionController.deleteControlledCollection()

getChildCollectionControllerList

public PropertyList getChildCollectionControllerList()
(non-Javadoc)

Specified by:
getChildCollectionControllerList in interface PropertyCollectionControllerModel
Returns:
child collection controller list
See Also:
PropertyCollectionControllerModel.getChildCollectionControllerList()

getChildPropertyControllerList

public PropertyList<PropertyControllerModel> getChildPropertyControllerList()
(non-Javadoc)

Specified by:
getChildPropertyControllerList in interface PropertyCollectionControllerModel
Returns:
child property controller list
See Also:
PropertyCollectionControllerModel.getChildPropertyControllerList()

getControlledCollection

public PropertyCollection getControlledCollection()
(non-Javadoc)

Specified by:
getControlledCollection in interface PropertyCollectionControllerModel
Returns:
controlled collection
See Also:
PropertyCollectionControllerModel.getControlledCollection()

getName

public java.lang.String getName()
(non-JSDoc)

Specified by:
getName in interface NamedPropertyCollection
Returns:
name
See Also:
NamedPropertyCollection.getName()

setName

public java.lang.String setName(java.lang.String newValue)
(non-JSDoc)

Specified by:
setName in interface NamedPropertyCollection
Parameters:
newValue - new name
Returns:
name value after the change
See Also:
NamedPropertyCollection.setName(java.lang.String)

isAddAvailable

public boolean isAddAvailable()
(non-Javadoc)

Specified by:
isAddAvailable in interface PropertyCollectionControllerModel
Returns:
is add available
See Also:
PropertyCollectionControllerModel.isAddAvailable()

isDeleteAvailable

public boolean isDeleteAvailable()
(non-Javadoc)

Specified by:
isDeleteAvailable in interface PropertyCollectionControllerModel
Returns:
is delete available
See Also:
PropertyCollectionControllerModel.isDeleteAvailable()

setControlledCollection

public PropertyCollection setControlledCollection(PropertyCollection setControlledCollection)
(non-Javadoc)

Specified by:
setControlledCollection in interface PropertyCollectionControllerModel
Parameters:
setControlledCollection - new controlled collection
Returns:
controlled collection value after the change
See Also:
PropertyCollectionControllerModel.setControlledCollection(org.deduced.PropertyCollection)

setIsAddAvailable

public boolean setIsAddAvailable(boolean setIsAddAvailable)
(non-Javadoc)

Specified by:
setIsAddAvailable in interface PropertyCollectionControllerModel
Parameters:
setIsAddAvailable - new is add available
Returns:
is add available value after the change
See Also:
PropertyCollectionControllerModel.setIsAddAvailable(boolean)

setIsDeleteAvailable

public boolean setIsDeleteAvailable(boolean setIsDeleteAvailable)
(non-Javadoc)

Specified by:
setIsDeleteAvailable in interface PropertyCollectionControllerModel
Parameters:
setIsDeleteAvailable - new is delete available
Returns:
is delete available value after the change
See Also:
PropertyCollectionControllerModel.setIsDeleteAvailable(boolean)

parent

public PropertyCollection<?,?> parent()
(non-Javadoc)

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

keyOnParent

public java.lang.Object keyOnParent()
(non-Javadoc)

Specified by:
keyOnParent in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
keyOnParent in class AbstractPropertyCollection<java.lang.Object,java.lang.Object>
Returns:
the key on the parent
See Also:
AbstractPropertyCollection.keyOnParent()

getProperty

public Property<java.lang.Object> getProperty(java.lang.Object propertyKey)
(non-Javadoc)

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

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object propertyKey)
(non-Javadoc)

Specified by:
getPropertyValue in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
getPropertyValue in class PropertyMap<java.lang.Object,java.lang.Object>
Parameters:
propertyKey - the property key
Returns:
the property value, null if the get failed
See Also:
PropertyMap.getPropertyValue(java.lang.Object)

setProperty

public java.lang.Object setProperty(java.lang.Object propertyKey,
                                    java.lang.Object value)
(non-Javadoc)

Specified by:
setProperty in interface PropertyCollection<java.lang.Object,java.lang.Object>
Overrides:
setProperty in class DynamicPropertyMap
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)

isAddValueValid

public boolean isAddValueValid(PropertyCollection<?,?> instance,
                               PropertyCollection<?,?> value,
                               boolean validateParent)
(non-Javadoc)

Specified by:
isAddValueValid in interface PropertyCollectionController
Parameters:
instance - the property instance to use while adding. If null, the fixed instance on the collection will be used.
value - the value to add to the collection
validateParent - option to validate the parent of the value as well. If true, then the parent must be null for all properties by value to be valid. If false, then the parent isn't validated.
Returns:
true if add is valid
See Also:
PropertyCollectionController.isAddValueValid(org.deduced.PropertyCollection, org.deduced.PropertyCollection, boolean)

setChildCollectionControllerList

public PropertyList setChildCollectionControllerList(PropertyList newValue)
(non-Javadoc)

Specified by:
setChildCollectionControllerList in interface PropertyCollectionControllerModel
Parameters:
newValue - new child collection controller list
Returns:
child collection controller list value after the change
See Also:
PropertyCollectionControllerModel.setChildCollectionControllerList(org.deduced.PropertyList)

setChildPropertyControllerList

public PropertyList setChildPropertyControllerList(PropertyList newValue)
(non-Javadoc)

Specified by:
setChildPropertyControllerList in interface PropertyCollectionControllerModel
Parameters:
newValue - new child property controller list
Returns:
child property controller list value after the change
See Also:
PropertyCollectionControllerModel.setChildPropertyControllerList(org.deduced.PropertyList)

deleteRemoveLocalObjectFromParent

protected void deleteRemoveLocalObjectFromParent()
(non-Javadoc)

Overrides:
deleteRemoveLocalObjectFromParent in class AbstractPropertyCollection<java.lang.Object,java.lang.Object>
See Also:
AbstractPropertyCollection.deleteRemoveLocalObjectFromParent()