com.ibm.dse.base.types
Class AbstractValidator
java.lang.Object
|
+--com.ibm.dse.base.types.AbstractValidator
- Direct Known Subclasses:
- DateValidator, DoubleValidator, FloatValidator, ICollValidator, IntegerStringValidator, IntegerValidator, KCollValidator, StringValidator
- public abstract class AbstractValidator
- extends java.lang.Object
- implements Validation, TypeConstants, java.io.Serializable
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 |
CONV_TYPE_DEFAULT,
CONV_TYPE_HOST,
CONV_TYPE_OUTPUT,
CONV_TYPE_SER,
CONV_TYPE_XML,
disabled,
hidden,
isDisabled,
isHidden,
isMandatory,
isOmitted,
isReadOnly,
mandatory,
omitted,
readOnly,
TYPE_DEFAULT,
TYPE_REGISTRY_INIT_SIZE |
Constructor Summary |
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. |
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 |
validate(java.lang.String toValidate,
PropertyDescription descriptor)
Validates the String passed by first unformatting it to an Object of the appropriate Type and
if successful, the object is returned, otherwise an appropriate exception is thrown. |
abstract java.lang.Object |
validateForType(java.lang.Object toValidate,
PropertyDescription descriptor)
Validates the object passed and if successful, the object is returned, otherwise an
appropriate exception is thrown. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
keyValuePairs
protected final java.util.Hashtable keyValuePairs
- The parameterization for this Validator, understood by concrete subclasses
AbstractValidator
public AbstractValidator(java.util.Hashtable keyValuePairs)
- This constructor creates a Validator for business objects of the associated Type.
- Parameters:
keyValuePairs
- Hashtable
getParameters
public java.util.Hashtable getParameters()
- Returns the keyValuePairs hashtable.
- Returns:
- java.util.Hashtable
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.
Parameters required by the specific type validator may be taken from the owner descriptor
by using the descriptor passed as argument.
- Specified by:
- validate in interface Validation
- Parameters:
toValidate
- Objectdescriptor
- PropertyDescription- Throws:
- DSETypeException - Validation is unsuccessful.
validate
public java.lang.Object validate(java.lang.String toValidate,
PropertyDescription descriptor)
throws DSETypeException
- Validates the String passed by first unformatting it to an Object of the appropriate Type and
if successful, the object is returned, otherwise an appropriate exception is thrown.
Parameters required by the specific type validator may be taken from the owner descriptor
by using the descriptor passed as argument.
- Specified by:
- validate in interface Validation
- Parameters:
toValidate
- Stringdescriptor
- PropertyDescription- Throws:
- DSETypeException - Validation is unsuccessful.
validateForType
public abstract java.lang.Object validateForType(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.
Parameters required by the specific type validator may be taken from the owner descriptor
by using the descriptor passed as argument.
- Parameters:
toValidate
- Objectdescriptor
- PropertyDescription- Throws:
- DSETypeException - Validation is unsuccessful.