org.deduced.controller.implementation
Class DirectPropertyController

java.lang.Object
  extended by org.deduced.AbstractPropertyCollection<K,V>
      extended by org.deduced.FixedPropertyInstanceCollection<java.lang.Object,java.lang.Object>
          extended by org.deduced.controller.implementation.PropertyControllerModelImplementation
              extended by org.deduced.controller.implementation.DirectPropertyController
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, PropertyController, PropertyControllerModel, NamedPropertyCollection, PropertyCollection<java.lang.Object,java.lang.Object>, PropertyListener<java.lang.Object,java.lang.Object>
Direct Known Subclasses:
FlyWheelPropertyController

public class DirectPropertyController
extends PropertyControllerModelImplementation
implements PropertyController, PropertyListener<java.lang.Object,java.lang.Object>

Title: DirectPropertyController

Description: DirectPropertyController is used to control a property directly in memory.

Author:
Steve McDuff

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deduced.AbstractPropertyCollection
AbstractPropertyCollection.CollectionToDeleteMonitor
 
Field Summary
private  DeducedControllerLayerExtension controlLayer
          control layer
private static long serialVersionUID
          serial ID
 
Fields inherited from class org.deduced.controller.implementation.PropertyControllerModelImplementation
KEY_SET
 
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.PropertyControllerModel
CONTROLLED_COLLECTION_INSTANCE, CONTROLLED_PROPERTY_INSTANCE_INSTANCE, CONTROLLED_PROPERTY_VALUE_TYPE_INSTANCE, IS_CHANGEABLE_INSTANCE, IS_REMOVABLE_INSTANCE, PROPERTY_CONTROLLER_MODEL_TYPE, PROPERTY_KEY_INSTANCE, PROPERTY_VALUE_INSTANCE
 
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
DirectPropertyController(DeducedControllerLayerExtension setControlLayer)
          DirectPropertyController Constructor
 
Method Summary
private  void addControlledCollectionListener()
          add Controlled Collection Listener
static Task baseCreateAndSetControlledProperty(PropertyCollection<?,?> createType, boolean deletePreviousValue, PropertyController controller)
          base Create And Set Controlled Property
static Task baseRemoveControlledProperty(boolean deletePreviousValue, PropertyController controller)
          base Remove Controlled Property
static Task baseSetControlledProperty(java.lang.Object value, boolean deletePreviousValue, PropertyController controller, ModelFactory validatorFactory)
          base Set Controlled Property
static void baseUpdateValue(PropertyController controller)
          base Update Value of the monitored property
 Task createAndSetControlledProperty(PropertyCollection<?,?> createType, boolean deletePreviousValue)
          (non-Javadoc)
 void delete()
          (non-Javadoc)
 DeducedControllerLayerExtension getControlLayer()
          getControlLayer
 boolean isNewValueValid(java.lang.Object newValue, boolean validateParent)
          (non-Javadoc)
 void propertyChanged(PropertyChangeEvent<?,?> event)
          (non-Javadoc)
private  void removeControlledCollectionListener()
          remove Controlled Collection Listener
 Task removeControlledProperty(boolean deletePreviousValue)
          (non-Javadoc)
 PropertyCollection setControlledCollection(PropertyCollection setControlledCollection)
          (non-Javadoc)
 Task setControlledProperty(java.lang.Object value, boolean deletePreviousValue)
          (non-Javadoc)
 java.lang.Object setPropertyKey(java.lang.Object setPropertyKey)
          (non-Javadoc)
private  void updateValue()
          update the Value of the monitored property
static void validatePropertyUpdate(PropertyCollection<?,?> changedCollection, java.lang.Object newValue, ModelFactory modelFactory, PropertyCollection<?,?> controlledPropertyInstance, boolean validateParent)
          validate Property Update
 
Methods inherited from class org.deduced.controller.implementation.PropertyControllerModelImplementation
asKeySet, clone, createInstancesAndTypes, createKeyList, equals, fillInstancesAndTypes, fillInstancesAndTypesFromSchema, fillTypeLists, getControlledCollection, getControlledCollection, getControlledPropertyInstance, getControlledPropertyInstance, getControlledPropertyValueType, getControlledPropertyValueType, getName, getName, getPropertyKey, getPropertyKey, getPropertyValue, getPropertyValue, getPropertyValue, isChangeable, isChangeable, isRemovable, isRemovable, resetListFixedInstances, setControlledCollection, setControlledPropertyInstance, setControlledPropertyInstance, setControlledPropertyValueType, setControlledPropertyValueType, setIsChangeable, setIsChangeable, setIsRemovable, setIsRemovable, setName, setName, setProperty, setPropertyKey, setPropertyValue, setPropertyValue, type
 
Methods inherited from class org.deduced.FixedPropertyInstanceCollection
addProperty, areKeysAssignedAutomatically, containsKey, getProperty, iterator, iteratorByValue, removeProperty, removePropertyInstance, removePropertyValue, size
 
Methods inherited from class org.deduced.AbstractPropertyCollection
activate, addListener, asPropertyList, asPropertyMap, asValueList, asValueMap, callObjectClone, classLogger, cleanNewlyClonedValue, clear, clearCollectionMonitoredForDelete, cloneCollection, containsInstance, containsValue, createUniqueID, deleteClearAllProperties, deleteClearListenerList, deleteFireDeleteEvent, deleteProcessCompletedValidation, deleteRemoveLocalObjectFromParent, deleteValidateEmptyListenerList, deleteValidateNoPendingReferences, firePropertyChangeEvent, flushCollectionsWithNewParent, flushCollectionsWithNewParent, getActionInvoker, getCheckDeleteMode, getCheckDeleteRunner, getFixedInstance, getInstanceIdentityKey, hashCode, id, instanceKey, internalFirePropertyChangeEvent, invokeAction, isActivated, isDeleteCheckedOnClearParent, isEmpty, isListenerRegistered, isParentOrKeyNull, keyOnParent, parent, removeListener, requiresChangeEvent, setActionInvoker, setCheckDeleteMode, setCheckDeleteRunner, setDeleteCheckedOnClearParent, setFixedInstance, setParent, 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.controller.PropertyControllerModel
getControlledCollection, getControlledPropertyInstance, getControlledPropertyValueType, getPropertyKey, getPropertyValue, isChangeable, isRemovable, setControlledPropertyInstance, setControlledPropertyValueType, setIsChangeable, setIsRemovable, setPropertyValue
 
Methods inherited from interface org.deduced.NamedPropertyCollection
getName, setName
 
Methods inherited from interface org.deduced.PropertyCollection
activate, addListener, addProperty, areKeysAssignedAutomatically, asKeySet, asPropertyList, asPropertyMap, asValueList, asValueMap, clear, clone, containsInstance, containsKey, containsValue, getFixedInstance, getProperty, getPropertyValue, id, instanceKey, invokeAction, isActivated, isEmpty, isListenerRegistered, iterator, iteratorByValue, keyOnParent, parent, removeListener, removeProperty, removePropertyInstance, removePropertyValue, setFixedInstance, setParent, setProperty, size, type, valueKey
 

Field Detail

controlLayer

private DeducedControllerLayerExtension controlLayer
control layer


serialVersionUID

private static final long serialVersionUID
serial ID

See Also:
Constant Field Values
Constructor Detail

DirectPropertyController

public DirectPropertyController(DeducedControllerLayerExtension setControlLayer)
DirectPropertyController Constructor

Parameters:
setControlLayer - control layer to use
Method Detail

getControlLayer

public DeducedControllerLayerExtension getControlLayer()
getControlLayer

Returns:
the control layer

setControlledProperty

public Task setControlledProperty(java.lang.Object value,
                                  boolean deletePreviousValue)
(non-Javadoc)

Specified by:
setControlledProperty in interface PropertyController
Parameters:
value - the new value
deletePreviousValue - option to delete the previous value in the property. This option only has effect if the property contains a property collection and the property isn't a reference. It will call delete on the previous value.
Returns:
a task used to monitor the change request
See Also:
PropertyController.setControlledProperty(java.lang.Object, boolean)

baseSetControlledProperty

public static Task baseSetControlledProperty(java.lang.Object value,
                                             boolean deletePreviousValue,
                                             PropertyController controller,
                                             ModelFactory validatorFactory)
base Set Controlled Property

Parameters:
value - new value for the property
deletePreviousValue - option to delete the previous value. Only applies to values of the property collection type that are owned by value.
controller - the property controller
validatorFactory - the model factory for validation
Returns:
a task monitoring the property update

removeControlledProperty

public Task removeControlledProperty(boolean deletePreviousValue)
(non-Javadoc)

Specified by:
removeControlledProperty in interface PropertyController
Parameters:
deletePreviousValue - option to delete the value in the property. This option only has effect if the property contains a property collection and the property isn't a reference. It will call delete on the previous value.
Returns:
a task used to monitor the change request
See Also:
PropertyController.removeControlledProperty(boolean)

baseRemoveControlledProperty

public static Task baseRemoveControlledProperty(boolean deletePreviousValue,
                                                PropertyController controller)
base Remove Controlled Property

Parameters:
deletePreviousValue - option to delete the previous value
controller - the controller of the property to remove
Returns:
a task monitoring the removal process

setControlledCollection

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

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

updateValue

private void updateValue()
update the Value of the monitored property


baseUpdateValue

public static void baseUpdateValue(PropertyController controller)
base Update Value of the monitored property

Parameters:
controller - the controller to update

addControlledCollectionListener

private void addControlledCollectionListener()
add Controlled Collection Listener


removeControlledCollectionListener

private void removeControlledCollectionListener()
remove Controlled Collection Listener


delete

public void delete()
(non-Javadoc)

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

setPropertyKey

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

Specified by:
setPropertyKey in interface PropertyControllerModel
Overrides:
setPropertyKey in class PropertyControllerModelImplementation
Parameters:
setPropertyKey - new property key
Returns:
property key value after the change
See Also:
PropertyControllerModel.setPropertyKey(java.lang.Object)

propertyChanged

public void propertyChanged(PropertyChangeEvent<?,?> event)
(non-Javadoc)

Specified by:
propertyChanged in interface PropertyListener<java.lang.Object,java.lang.Object>
Parameters:
event - the event that was generated
See Also:
PropertyListener.propertyChanged(org.deduced.PropertyChangeEvent)

createAndSetControlledProperty

public Task createAndSetControlledProperty(PropertyCollection<?,?> createType,
                                           boolean deletePreviousValue)
(non-Javadoc)

Specified by:
createAndSetControlledProperty in interface PropertyController
Parameters:
createType - the created object type
deletePreviousValue - option to delete the previous value in the property. This option only has effect if the property contains a property collection and the property isn't a reference. It will call delete on the previous value.
Returns:
a task used to monitor the change request
See Also:
PropertyController.createAndSetControlledProperty(org.deduced.PropertyCollection, boolean)

baseCreateAndSetControlledProperty

public static Task baseCreateAndSetControlledProperty(PropertyCollection<?,?> createType,
                                                      boolean deletePreviousValue,
                                                      PropertyController controller)
base Create And Set Controlled Property

Parameters:
createType - the type to create
deletePreviousValue - option to delete the previous value. Only valid if the value is a property collection held by value.
controller - the property controller to modify
Returns:
a task to monitor the create operation

isNewValueValid

public boolean isNewValueValid(java.lang.Object newValue,
                               boolean validateParent)
(non-Javadoc)

Specified by:
isNewValueValid in interface PropertyController
Parameters:
newValue - the new value
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 the new value is valid, false otherwise.
See Also:
PropertyController.isNewValueValid(java.lang.Object, boolean)

validatePropertyUpdate

public static void validatePropertyUpdate(PropertyCollection<?,?> changedCollection,
                                          java.lang.Object newValue,
                                          ModelFactory modelFactory,
                                          PropertyCollection<?,?> controlledPropertyInstance,
                                          boolean validateParent)
validate Property Update

Parameters:
changedCollection - the collection being changed
newValue - the new value
modelFactory - the model factory to used to create validation models
controlledPropertyInstance - the property instance being changed
validateParent - option to validate the parent of the new value or not.