com.sybase.uep.bobclient.data
Class Validator

java.lang.Object
  extended by com.sybase.uep.bobclient.data.Validator
All Implemented Interfaces:
ValidatorConstants

public class Validator
extends java.lang.Object
implements ValidatorConstants

This is actually a factory class that forwards the real Validation to the correct Validator class. For instance the pattern match validation will be forwarded to the PatternMatchValidator class

Author:
markusb

Field Summary
 
Fields inherited from interface com.sybase.uep.bobclient.constants.ValidatorConstants
PATTERN_MATCH_SUBTYPE_AFTER, PATTERN_MATCH_SUBTYPE_BEFORE, PATTERN_MATCH_SUBTYPE_CONTAINS, PATTERN_MATCH_SUBTYPE_ENDS_WITH, PATTERN_MATCH_SUBTYPE_EQUALS, PATTERN_MATCH_SUBTYPE_IS_GREATER_THAN, PATTERN_MATCH_SUBTYPE_IS_GREATER_THAN_OR_EQUAL_TO, PATTERN_MATCH_SUBTYPE_IS_LESS_THAN, PATTERN_MATCH_SUBTYPE_IS_LESS_THAN_OR_EQUAL_TO, PATTERN_MATCH_SUBTYPE_LENGTH_IS_EQUAL_TO, PATTERN_MATCH_SUBTYPE_LENGTH_IS_GREATER_THAN, PATTERN_MATCH_SUBTYPE_LENGTH_IS_GREATER_THAN_OR_EQUAL_TO, PATTERN_MATCH_SUBTYPE_LENGTH_IS_LESS_THAN, PATTERN_MATCH_SUBTYPE_LENGTH_IS_LESS_THAN_OR_EQUAL_TO, PATTERN_MATCH_SUBTYPE_MATCHES_REGULAR_EXPRESSION, PATTERN_MATCH_SUBTYPE_STARTS_WITH, VALIDATION_TYPE_PATTERN_MATCH
 
Constructor Summary
Validator(java.lang.String type, java.lang.String subtype, java.lang.String value, int errorMessageRID)
          Create Validator object
Validator(java.lang.String type, java.lang.String subtype, java.lang.String value, java.lang.String errorMessage)
          Create Validator object
 
Method Summary
 java.lang.String getErrorMessage()
          Return the specified error message for the case that the validation fails
 java.lang.String getValue()
          Return the given value
 boolean validate(java.lang.String inputValue, java.lang.String dataType)
          Do the validation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator(java.lang.String type,
                 java.lang.String subtype,
                 java.lang.String value,
                 int errorMessageRID)
Create Validator object

Parameters:
type - - Validation type, currently only “pattern match”. Might be more in the future
subType - - Validation subtype as defined in the ValidatorConstants
value - - The value to validate against
errorMessage - - The message to display in case the validation fails

Validator

public Validator(java.lang.String type,
                 java.lang.String subtype,
                 java.lang.String value,
                 java.lang.String errorMessage)
Create Validator object

Parameters:
type - - Validation type, currently only “pattern match”. Might be more in the future
subType - - Validation subtype as defined in the ValidatorConstants
value - - The value to validate against
errorMessage - - The message to display in case the validation fails
Method Detail

validate

public boolean validate(java.lang.String inputValue,
                        java.lang.String dataType)
Do the validation

Parameters:
The - value to validate
Returns:
Validation succeeded or not

getErrorMessage

public java.lang.String getErrorMessage()
Return the specified error message for the case that the validation fails

Returns:
Error message

getValue

public java.lang.String getValue()
Return the given value

Returns:
The given value