IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base.types
Class AbstractValidator

java.lang.Object
  extended bycom.ibm.dse.base.types.AbstractValidator
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, TypeConstants, Validation
Direct Known Subclasses:
DateValidator, DoubleValidator, FloatValidator, ICollValidator, IntegerStringValidator, IntegerValidator, KCollValidator, StringValidator

public abstract class AbstractValidator
extends java.lang.Object
implements Validation, TypeConstants, java.io.Externalizable

This class resides at the top of the Validator hierarchy and provides an abstract implementation of the Validation interface for Type specific Validators to extend.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable keyValuePairs
          The parameterization for this Validator, understood by concrete subclasses
 
Fields inherited from interface com.ibm.dse.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
AbstractValidator()
          This constructor creates a Validator for business objects of the associated Type.
AbstractValidator(java.util.Hashtable keyValuePairs)
          This constructor creates a Validator for business objects of the associated Type.
 
Method Summary
 java.util.Hashtable getParameters()
          Returns the keyValuePairs Hashtable.
 void readExternal(java.io.ObjectInput s)
          Invokes the object creation from an ObjectInput.
 java.lang.Object validate(java.lang.Object toValidate, PropertyDescription descriptor)
          Validates the object and, if successful, returns the object.
 java.lang.Object validate(java.lang.Object toValidate, PropertyDescription descriptor, Hashtable parameters)
          Validates the object and, if successful, returns the object.
 java.lang.Object validate(java.lang.String toValidate, PropertyDescription descriptor)
          Validates the object and, if successful, returns the object.
 java.lang.Object validate(java.lang.String toValidate, java.lang.String convType, PropertyDescription descriptor)
          Validates the object and, if successful, returns the object.
 java.lang.Object validate(java.lang.String toValidate, java.lang.String convType, PropertyDescription descriptor, Hashtable parameters)
          Validates the object and, if successful, returns the object.
 java.lang.Object validateForType(java.lang.Object toValidate, PropertyDescription descriptor)
          Validates the object and, if successful, returns the object.
 java.lang.Object validateForType(java.lang.Object toValidate, PropertyDescription descriptor, Hashtable parameters)
          Validates the object and, if successful, returns the object.
 void validateParams(PropertyDescription pd)
          Validates the parameters externaly defined for this validator
 void writeExternal(java.io.ObjectOutput s)
          Provides concrete serialization handling for the Context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyValuePairs

protected java.util.Hashtable keyValuePairs
The parameterization for this Validator, understood by concrete subclasses

Constructor Detail

AbstractValidator

public AbstractValidator()
This constructor creates a Validator for business objects of the associated Type.


AbstractValidator

public AbstractValidator(java.util.Hashtable keyValuePairs)
This constructor creates a Validator for business objects of the associated Type.

Parameters:
keyValuePairs - Hashtable
Method Detail

getParameters

public java.util.Hashtable getParameters()
Returns the keyValuePairs Hashtable.

Returns:
java.util.Hashtable

readExternal

public void readExternal(java.io.ObjectInput s)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Invokes the object creation from an ObjectInput. The ObjectInput contains a context and all of its children.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
s - java.io.ObjectInput
Throws:
java.io.IOException.
java.lang.ClassNotFoundException.
java.io.IOException
java.lang.ClassNotFoundException

validate

public java.lang.Object validate(java.lang.Object toValidate,
                                 PropertyDescription descriptor)
                          throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. Parameters required by the specific type validator may be taken from the owner descriptor by using the descriptor passed as an argument.

Specified by:
validate in interface Validation
Parameters:
toValidate - Object
descriptor - PropertyDescription
Throws:
DSETypeException - Validation is unsuccessful.

validate

public java.lang.Object validate(java.lang.Object toValidate,
                                 PropertyDescription descriptor,
                                 Hashtable parameters)
                          throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. Parameters required by the specific type validator may be taken from the Hashtable passed as an argument.

Specified by:
validate in interface Validation
Parameters:
toValidate - Object
descriptor - PropertyDescription
parameters - com.ibm.dse.base.Hashtable
Throws:
DSETypeException - Validation is unsuccessful.

validate

public java.lang.Object validate(java.lang.String toValidate,
                                 PropertyDescription descriptor)
                          throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. Parameters required by the specific type validator may be taken from the owner descriptor by using the descriptor passed as an argument.

Specified by:
validate in interface Validation
Parameters:
toValidate - String
descriptor - PropertyDescription
Throws:
DSETypeException - Validation is unsuccessful.

validate

public java.lang.Object validate(java.lang.String toValidate,
                                 java.lang.String convType,
                                 PropertyDescription descriptor)
                          throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. If convType is not supported, the default conversion type is used. Parameters required by the specific type validator may be taken from the owner descriptor by using the descriptor passed as an argument.

Specified by:
validate in interface Validation
Parameters:
toValidate - String
convType - String
descriptor - PropertyDescription
Throws:
DSETypeException - Validation is unsuccessful.

validate

public java.lang.Object validate(java.lang.String toValidate,
                                 java.lang.String convType,
                                 PropertyDescription descriptor,
                                 Hashtable parameters)
                          throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. If convType is not supported the default conversion type is used. Parameters required by the specific type validator may be taken from the Hashtable passed as an argument.

Specified by:
validate in interface Validation
Parameters:
toValidate - String
convType - String
descriptor - PropertyDescription
parameters - com.ibm.dse.base.Hashtable
Throws:
DSETypeException - Validation is unsuccessful.

validateForType

public java.lang.Object validateForType(java.lang.Object toValidate,
                                        PropertyDescription descriptor)
                                 throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. Parameters required by the specific type validator may be taken from the owner descriptor by using the descriptor passed as an argument.

Parameters:
toValidate - Object
descriptor - PropertyDescription
Throws:
DSETypeException - Validation is unsuccessful.

validateForType

public java.lang.Object validateForType(java.lang.Object toValidate,
                                        PropertyDescription descriptor,
                                        Hashtable parameters)
                                 throws DSETypeException
Validates the object and, if successful, returns the object. Otherwise, the method throws the appropriate exception. Parameters required by the specific type validator may be taken from the Hashtable passed as an argument.

Parameters:
toValidate - Object
descriptor - PropertyDescription
parameters - com.ibm.dse.base.Hashtable
Throws:
DSETypeException - Validation is unsuccessful.

validateParams

public void validateParams(PropertyDescription pd)
                    throws DSETypeException
Validates the parameters externaly defined for this validator

Specified by:
validateParams in interface Validation
Parameters:
pd - com.ibm.dse.base.types.PropertyDescription
Throws:
DSETypeException - If parameter validation fails.

writeExternal

public void writeExternal(java.io.ObjectOutput s)
                   throws java.io.IOException
Provides concrete serialization handling for the Context. This method serializes the current context and all of its children.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
s - java.io.ObjectOutput
Throws:
java.io.IOException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005