IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.base.types
Class ICollValidator

java.lang.Object
  extended bycom.ibm.btt.base.types.AbstractValidator
      extended bycom.ibm.btt.base.types.ICollValidator
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, TypeConstants, Validation

public class ICollValidator
extends AbstractValidator

This class is a Validator for compound business objects that are IndexedCollections. It checks if the inner elements of the indexed collection are valid and also if the indexed collection size is between the minSize and the maxSize. Both of these properties are defined within the keyValuePairs.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.base.types.AbstractValidator
keyValuePairs
 
Fields inherited from interface com.ibm.btt.base.types.TypeConstants
amended, CONV_TYPE_DEFAULT, CONV_TYPE_HOST, CONV_TYPE_OUTPUT, CONV_TYPE_SER, CONV_TYPE_XML, disabled, hidden, isAmended, isDisabled, isHidden, isMandatory, isOmitted, isReadOnly, mandatory, omitted, readOnly, TYPE_DEFAULT, TYPE_REGISTRY_INIT_SIZE
 
Constructor Summary
ICollValidator()
          Creates an ICollValidator object.
ICollValidator(java.util.Hashtable keyValuePairs)
          Creates an ICollValidator object.
 
Method Summary
 java.lang.Object validate(java.lang.Object toValidate, PropertyDescription descriptor)
          Validates the passed object and, if successful, returns the object.
 java.lang.Object validate(java.lang.Object toValidate, PropertyDescription descriptor, Hashtable parameters)
          Validates the passed object and, if successful, returns the object.
 java.lang.Object validateForType(java.lang.Object toValidate, PropertyDescription descriptor, Hashtable parameters)
          Validates the passed object (which must be an indexed collection) and, if successful, returns the object.
protected  java.lang.Object validateICollSize(java.lang.Object toValidate, PropertyDescription descriptor)
          Checks that the indexed collection size lays between the minimum and the maximum values specified as parameters of the owner descriptor or as parameters of the validator.
protected  java.lang.Object validateICollSize(java.lang.Object toValidate, PropertyDescription descriptor, Hashtable parameters)
          Checks that the indexed collection size lays between the minimum and the maximum values specified as parameters of the Hashtable, as parameters of the owner descriptor, or as parameters of the validator.
protected  java.lang.Object validateInnerElements(java.util.Vector elements, PropertyDescription descriptor)
          Validates the inner elements of the indexed collection passed within a vector.
 
Methods inherited from class com.ibm.btt.base.types.AbstractValidator
getParameters, readExternal, validate, validate, validate, validateForType, validateParams, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICollValidator

public ICollValidator()
Creates an ICollValidator object.


ICollValidator

public ICollValidator(java.util.Hashtable keyValuePairs)
Creates an ICollValidator object.

Parameters:
keyValuePairs - java.util.Hashtable
Method Detail

validate

public java.lang.Object validate(java.lang.Object toValidate,
                                 PropertyDescription descriptor)
                          throws DSETypeException
Validates the passed object and, if successful, returns the object.

Specified by:
validate in interface Validation
Overrides:
validate in class AbstractValidator
Parameters:
toValidate - Object
descriptor - PropertyDescription
Throws:
DSETypeException - - Thrown if validation is unsuccessful

validate

public java.lang.Object validate(java.lang.Object toValidate,
                                 PropertyDescription descriptor,
                                 Hashtable parameters)
                          throws DSETypeException
Validates the passed object and, if successful, returns the object.

Specified by:
validate in interface Validation
Overrides:
validate in class AbstractValidator
Parameters:
toValidate - Object
descriptor - PropertyDescription
parameters - com.ibm.btt.base.Hashtable
Throws:
DSETypeException - - Thrown if validation is unsuccessful

validateForType

public java.lang.Object validateForType(java.lang.Object toValidate,
                                        PropertyDescription descriptor,
                                        Hashtable parameters)
                                 throws DSETypeException
Validates the passed object (which must be an indexed collection) and, if successful, returns the object. The validation succeeds if all elements in the indexed collection are valid.

Overrides:
validateForType in class AbstractValidator
Parameters:
toValidate - Object
descriptor - PropertyDescription
parameters - com.ibm.btt.base.Hashtable
Throws:
DSETypeException - - Thrown if the validation is unsuccessful

validateICollSize

protected java.lang.Object validateICollSize(java.lang.Object toValidate,
                                             PropertyDescription descriptor)
                                      throws DSETypeException
Checks that the indexed collection size lays between the minimum and the maximum values specified as parameters of the owner descriptor or as parameters of the validator.

Parameters:
toValidate - java.lang.Object - The indexed collection to validate
descriptor - com.ibm.btt.base.types.PropertyDescription
Returns:
java.lang.Object - The valid indexed collection
Throws:
DSETypeException

validateICollSize

protected java.lang.Object validateICollSize(java.lang.Object toValidate,
                                             PropertyDescription descriptor,
                                             Hashtable parameters)
                                      throws DSETypeException
Checks that the indexed collection size lays between the minimum and the maximum values specified as parameters of the Hashtable, as parameters of the owner descriptor, or as parameters of the validator.

Parameters:
toValidate - java.lang.Object - The indexed collection to validate
descriptor - com.ibm.btt.base.types.PropertyDescription
parameters - com.ibm.btt.base.Hashtable
Returns:
java.lang.Object - The valid indexed collection
Throws:
DSETypeException

validateInnerElements

protected java.lang.Object validateInnerElements(java.util.Vector elements,
                                                 PropertyDescription descriptor)
                                          throws DSETypeException
Validates the inner elements of the indexed collection passed within a vector.

Parameters:
elements - - The vector of inner elements
descriptor - - The property descriptor that owns this validator
Returns:
java.lang.Object - The vector containing valid inner elements
Throws:
DSETypeException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005