com.ibm.dse.base.types
Class KCollValidator

java.lang.Object
  |
  +--com.ibm.dse.base.types.AbstractValidator
        |
        +--com.ibm.dse.base.types.KCollValidator

public class KCollValidator
extends AbstractValidator

This class is a Validator for compound business objects which are KeyedCollections. It checks if the inner elements of the keyed collection are valids. It should be extended if further rules (related to the business object that the keyed collection represents) are required to be applied.

See Also:
Serialized Form

Fields inherited from class com.ibm.dse.base.types.AbstractValidator
keyValuePairs
 
Constructor Summary
KCollValidator(java.util.Hashtable keyValuePairs)
          Creates a KCollValidator object.
 
Method Summary
 java.lang.Object validate(java.lang.Object toValidate, PropertyDescription descriptor)
          Validates the object passed and if successful, the object is returned, otherwise an appropriate exception is thrown.
 java.lang.Object validateForType(java.lang.Object toValidate, PropertyDescription descriptor)
          Validates the object passed (that must be a keyed collection or a hashtable containing the keyed collection elements) and if successful, the object is returned, otherwise an appropriate exception is thrown.
protected  java.lang.Object validateHashtable(Hashtable elements, PropertyDescription descriptor)
          Validates the keyed collection elements passed within a Hastable If validation fails a DSETypeException is thrown, otherwise the input hashtable is returned.
 
Methods inherited from class com.ibm.dse.base.types.AbstractValidator
getParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KCollValidator

public KCollValidator(java.util.Hashtable keyValuePairs)
Creates a KCollValidator object.
Parameters:
keyValuePairs - java.util.Hashtable
Method Detail

validate

public java.lang.Object validate(java.lang.Object toValidate,
                                 PropertyDescription descriptor)
                          throws DSETypeException
Validates the object passed and if successful, the object is returned, otherwise an appropriate exception is thrown.
Overrides:
validate in class AbstractValidator
Parameters:
toValidate - Object
descriptor - PropertyDescription
Returns:
Object
Throws:
DSETypeException - Validation is unsuccessful.

validateForType

public java.lang.Object validateForType(java.lang.Object toValidate,
                                        PropertyDescription descriptor)
                                 throws DSETypeException
Validates the object passed (that must be a keyed collection or a hashtable containing the keyed collection elements) and if successful, the object is returned, otherwise an appropriate exception is thrown. Validation will succeed if all elements in the keyed collection are valid.
Overrides:
validateForType in class AbstractValidator
Parameters:
toValidate - Object
descriptor - PropertyDescription
Returns:
Object
Throws:
DSETypeException - Thrown if the validation is unsuccessful.

validateHashtable

protected java.lang.Object validateHashtable(Hashtable elements,
                                             PropertyDescription descriptor)
                                      throws DSETypeException
Validates the keyed collection elements passed within a Hastable If validation fails a DSETypeException is thrown, otherwise the input hashtable is returned.
Parameters:
elements - Hashtable
descriptor - PropertyDescription
Returns:
java.lang.Object