org.deduced.validation.validator.implementation
Class ErrorMessageBasedValidatorImplementation

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.validation.validator.implementation.ErrorMessageBasedValidatorImplementation
All Implemented Interfaces:
java.lang.Cloneable, PropertyCollection<java.lang.Object,java.lang.Object>, ErrorMessageBasedValidator, Validator

public class ErrorMessageBasedValidatorImplementation
extends FixedPropertyInstanceCollection<java.lang.Object,java.lang.Object>
implements ErrorMessageBasedValidator

Java Implementation used to represent the type : error message based validator Class generated by org.deduced.generator.VelocityGenerator Using template : org/deduced/generator/java/JavaImplementation.vm


Nested Class Summary
 
Nested classes/interfaces inherited from class org.deduced.AbstractPropertyCollection
AbstractPropertyCollection.CollectionToDeleteMonitor
 
Field Summary
private  java.lang.Object currentValue
          member variable holding the value for : current value
private  java.lang.String errorMessage
          member variable holding the value for : error message
private  boolean isValid
          member variable holding the value for : is valid
static java.util.Set<java.lang.Object> KEY_SET
          list of keys held in this collection
private  ValidationModel model
          member variable holding the value for : model
 
Fields inherited from class org.deduced.AbstractPropertyCollection
CHECK_DELETE_MODE_AUTOMATIC, CHECK_DELETE_MODE_MANUAL, COLLECTION_TO_DELETE
 
Fields inherited from interface org.deduced.validation.validator.ErrorMessageBasedValidator
ERROR_MESSAGE_BASED_VALIDATOR_TYPE
 
Fields inherited from interface org.deduced.validation.validator.Validator
CURRENT_VALUE_INSTANCE, ERROR_MESSAGE_INSTANCE, IS_VALID_INSTANCE, MODEL_INSTANCE, VALIDATOR_TYPE
 
Fields inherited from interface org.deduced.PropertyCollection
PROPERTY_COLLECTION_TYPE
 
Constructor Summary
ErrorMessageBasedValidatorImplementation()
          Default constructor for the type : error message based validator
 
Method Summary
 java.util.Set<java.lang.Object> asKeySet()
           
 java.lang.Object clone()
          (non-Javadoc)
static void createInstancesAndTypes()
          create instances and types
static void createKeyList()
          static method used to initialize the key list on the property collection
 boolean equals(java.lang.Object o)
          (non-Javadoc)
static void fillInstancesAndTypes()
          fill instances and types phase 1
static void fillInstancesAndTypesFromSchema(PropertyCollection<?,?> schema)
          fill instances and types from a schema
static void fillTypeLists()
          fill instances and types phase 2
 java.lang.Object getCurrentValue()
          (non-Javadoc)
static java.lang.Object getCurrentValue(PropertyCollection<?,?> collection)
          Get the value of the instance : current value
 java.lang.String getErrorMessage()
          (non-Javadoc)
static java.lang.String getErrorMessage(PropertyCollection<?,?> collection)
          Get the value of the instance : error message
 ValidationModel getModel()
          (non-Javadoc)
static PropertyCollection getModel(PropertyCollection<?,?> collection)
          Get the value of the instance : model
 java.lang.Object getPropertyValue(java.lang.Object key)
          (non-Javadoc)
 boolean isValid()
          (non-Javadoc)
static java.lang.Boolean isValid(PropertyCollection<?,?> collection)
          Get the value of the instance : is valid
static void resetListFixedInstances(ErrorMessageBasedValidator instance)
          reset all the list fixed instances
 java.lang.Object setCurrentValue(java.lang.Object setValue)
          (non-Javadoc)
static java.lang.Object setCurrentValue(PropertyCollection collection, java.lang.Object value)
          set the value of the instance : current value
static java.lang.String setErrorMessage(PropertyCollection collection, java.lang.String value)
          set the value of the instance : error message
 java.lang.String setErrorMessage(java.lang.String setValue)
          (non-Javadoc)
 boolean setIsValid(boolean setValue)
          (non-Javadoc)
static java.lang.Boolean setIsValid(PropertyCollection collection, java.lang.Boolean value)
          set the value of the instance : is valid
static PropertyCollection setModel(PropertyCollection collection, PropertyCollection value)
          set the value of the instance : model
 ValidationModel setModel(ValidationModel setValue)
          (non-Javadoc)
 java.lang.Object setProperty(java.lang.Object key, java.lang.Object value)
          (non-Javadoc)
 PropertyCollectionType type()
          (non-Javadoc)
 
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, delete, 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.PropertyCollection
activate, addListener, addProperty, areKeysAssignedAutomatically, asPropertyList, asPropertyMap, asValueList, asValueMap, clear, containsInstance, containsKey, containsValue, delete, getFixedInstance, getProperty, id, instanceKey, invokeAction, isActivated, isEmpty, isListenerRegistered, iterator, iteratorByValue, keyOnParent, parent, removeListener, removeProperty, removePropertyInstance, removePropertyValue, setFixedInstance, setParent, size, valueKey
 

Field Detail

KEY_SET

public static java.util.Set<java.lang.Object> KEY_SET
list of keys held in this collection


currentValue

private java.lang.Object currentValue
member variable holding the value for : current value


isValid

private boolean isValid
member variable holding the value for : is valid


model

private ValidationModel model
member variable holding the value for : model


errorMessage

private java.lang.String errorMessage
member variable holding the value for : error message

Constructor Detail

ErrorMessageBasedValidatorImplementation

public ErrorMessageBasedValidatorImplementation()
Default constructor for the type : error message based validator

Method Detail

asKeySet

public java.util.Set<java.lang.Object> asKeySet()
Specified by:
asKeySet in interface PropertyCollection<java.lang.Object,java.lang.Object>
Returns:
the key set

type

public PropertyCollectionType type()
(non-Javadoc)

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

createKeyList

public static void createKeyList()
static method used to initialize the key list on the property collection


getCurrentValue

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

Specified by:
getCurrentValue in interface Validator
Returns:
current value
See Also:
Validator.getCurrentValue()

getCurrentValue

public static java.lang.Object getCurrentValue(PropertyCollection<?,?> collection)
Get the value of the instance : current value

Parameters:
collection - new collection from which to fetch the value
Returns:
current value

setCurrentValue

public java.lang.Object setCurrentValue(java.lang.Object setValue)
(non-Javadoc)

Specified by:
setCurrentValue in interface Validator
Parameters:
setValue - new current value
Returns:
current value value after the change
See Also:
Validator.setCurrentValue(java.lang.Object)

setCurrentValue

public static java.lang.Object setCurrentValue(PropertyCollection collection,
                                               java.lang.Object value)
set the value of the instance : current value

Parameters:
collection - new collection on which to set the value
value - new value for : current value
Returns:
current value

isValid

public boolean isValid()
(non-Javadoc)

Specified by:
isValid in interface Validator
Returns:
is valid
See Also:
Validator.isValid()

isValid

public static java.lang.Boolean isValid(PropertyCollection<?,?> collection)
Get the value of the instance : is valid

Parameters:
collection - new collection from which to fetch the value
Returns:
is valid

setIsValid

public boolean setIsValid(boolean setValue)
(non-Javadoc)

Specified by:
setIsValid in interface Validator
Parameters:
setValue - new is valid
Returns:
is valid value after the change
See Also:
Validator.setIsValid(boolean)

setIsValid

public static java.lang.Boolean setIsValid(PropertyCollection collection,
                                           java.lang.Boolean value)
set the value of the instance : is valid

Parameters:
collection - new collection on which to set the value
value - new value for : is valid
Returns:
is valid

getModel

public ValidationModel getModel()
(non-Javadoc)

Specified by:
getModel in interface Validator
Returns:
model
See Also:
Validator.getModel()

getModel

public static PropertyCollection getModel(PropertyCollection<?,?> collection)
Get the value of the instance : model

Parameters:
collection - new collection from which to fetch the value
Returns:
model

setModel

public ValidationModel setModel(ValidationModel setValue)
(non-Javadoc)

Specified by:
setModel in interface Validator
Parameters:
setValue - new model
Returns:
model value after the change
See Also:
Validator.setModel(org.deduced.ValidationModel)

setModel

public static PropertyCollection setModel(PropertyCollection collection,
                                          PropertyCollection value)
set the value of the instance : model

Parameters:
collection - new collection on which to set the value
value - new value for : model
Returns:
model

getErrorMessage

public java.lang.String getErrorMessage()
(non-Javadoc)

Specified by:
getErrorMessage in interface Validator
Returns:
error message
See Also:
Validator.getErrorMessage()

getErrorMessage

public static java.lang.String getErrorMessage(PropertyCollection<?,?> collection)
Get the value of the instance : error message

Parameters:
collection - new collection from which to fetch the value
Returns:
error message

setErrorMessage

public java.lang.String setErrorMessage(java.lang.String setValue)
(non-Javadoc)

Specified by:
setErrorMessage in interface Validator
Parameters:
setValue - new error message
Returns:
error message value after the change
See Also:
Validator.setErrorMessage(java.lang.String)

setErrorMessage

public static java.lang.String setErrorMessage(PropertyCollection collection,
                                               java.lang.String value)
set the value of the instance : error message

Parameters:
collection - new collection on which to set the value
value - new value for : error message
Returns:
error message

equals

public boolean equals(java.lang.Object o)
(non-Javadoc)

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

clone

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

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

setProperty

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

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

getPropertyValue

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

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

resetListFixedInstances

public static void resetListFixedInstances(ErrorMessageBasedValidator instance)
reset all the list fixed instances

Parameters:
instance - the instance that will get all its list fixed instances set

createInstancesAndTypes

public static void createInstancesAndTypes()
create instances and types


fillInstancesAndTypesFromSchema

public static void fillInstancesAndTypesFromSchema(PropertyCollection<?,?> schema)
fill instances and types from a schema

Parameters:
schema - the schema that contains the required instances and types

fillInstancesAndTypes

public static void fillInstancesAndTypes()
fill instances and types phase 1


fillTypeLists

public static void fillTypeLists()
fill instances and types phase 2