org.deduced.controller
Interface PropertyController

All Superinterfaces:
java.lang.Cloneable, NamedPropertyCollection, PropertyCollection<java.lang.Object,java.lang.Object>, PropertyControllerModel
All Known Implementing Classes:
DirectPropertyController, FlyWheelDynamicPropertyController, FlyWheelPropertyController

public interface PropertyController
extends PropertyControllerModel

Title: PropertyController

Description: PropertyController is used to control a single property in a property collection. It is used to restrict access to the property and validate changes.

Author:
Steve McDuff

Field Summary
 
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
 
Method Summary
 Task createAndSetControlledProperty(PropertyCollection<?,?> createType, boolean deletePreviousValue)
          create a new object from the factory and set it on our controlled property
 boolean isNewValueValid(java.lang.Object newValue, boolean validateParent)
          Verify if a value is valid for this property
 Task removeControlledProperty(boolean deleteValue)
          remove the property from the collection
 Task setControlledProperty(java.lang.Object value, boolean deletePreviousValue)
          set the property
 
Methods inherited from interface org.deduced.controller.PropertyControllerModel
getControlledCollection, getControlledPropertyInstance, getControlledPropertyValueType, getPropertyKey, getPropertyValue, isChangeable, isRemovable, setControlledCollection, setControlledPropertyInstance, setControlledPropertyValueType, setIsChangeable, setIsRemovable, setPropertyKey, 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, delete, getFixedInstance, getProperty, getPropertyValue, id, instanceKey, invokeAction, isActivated, isEmpty, isListenerRegistered, iterator, iteratorByValue, keyOnParent, parent, removeListener, removeProperty, removePropertyInstance, removePropertyValue, setFixedInstance, setParent, setProperty, size, type, valueKey
 

Method Detail

setControlledProperty

Task setControlledProperty(java.lang.Object value,
                           boolean deletePreviousValue)
set the property

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

removeControlledProperty

Task removeControlledProperty(boolean deleteValue)
remove the property from the collection

Parameters:
deleteValue - 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

createAndSetControlledProperty

Task createAndSetControlledProperty(PropertyCollection<?,?> createType,
                                    boolean deletePreviousValue)
create a new object from the factory and set it on our controlled property

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

isNewValueValid

boolean isNewValueValid(java.lang.Object newValue,
                        boolean validateParent)
Verify if a value is valid for this property

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.