IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.cs.invoker.base
Class BeanInvokerValidation

java.lang.Object
  extended bycom.ibm.btt.cs.invoker.base.BeanInvokerValidation
All Implemented Interfaces:
TypeConstants

public class BeanInvokerValidation
extends java.lang.Object
implements TypeConstants

Data can be validated before they are sent to EJB. Validation should be done inside an invoker. There is one validation supported: typed data validations. For typed data validation, Code Generation Tool will generate the pre-defined validation APIs according to the typed data definition. These pre-defined validations include StringValidatitor, FloatValidator, IntegerValidator, DoubleValidator and DateValidator etc.


Field Summary
 
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
BeanInvokerValidation()
           
 
Method Summary
 java.lang.Object dateValidator(java.lang.Object toValidate, java.lang.String lowerLimit, java.lang.String upperLimit, java.lang.String mask)
          Validates the object of the Date type and, if successful, returns the object.
 java.lang.Object doubleValidator(java.lang.Object toValidate, double minValue, double maxValue)
          Validates the object of the Double type and, if successful, returns the object.
 java.lang.Object floatValidator(java.lang.Object toValidate, float minValue, float maxValue)
          Validates the object of the Float type and, if successful, returns the object.
 java.lang.Object integerValidator(java.lang.Object toValidate, int minValue, int maxValue)
          Validates the object of the Integer type and, if successful, returns the object.
 java.lang.Object stringValidator(java.lang.Object toValidate, int minLength, int maxLength)
          Validates an object of the String type and, if successful, returns the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanInvokerValidation

public BeanInvokerValidation()
Method Detail

dateValidator

public java.lang.Object dateValidator(java.lang.Object toValidate,
                                      java.lang.String lowerLimit,
                                      java.lang.String upperLimit,
                                      java.lang.String mask)
                               throws DSETypeException
Validates the object of the Date type and, if successful, returns the object. Otherwise, this method throws an exception. This method first tries to get the parameters required for the validation from the Hashtable passed as an argument. If it does not find the parameters there, the method then tries the descriptor passed as an argument. If the method does not find the parameters in the descriptor, it gets them from the Constants of the type.

Parameters:
toValidate - Object
lowerLimit - A String representation for the earliest date allowed for the object.
upperLimit - A String representation for the latest date allowed for the object.
mask - converter using the java.text.SimpleDateFormat. Date Converter has the mask attribute, which sets the pattern of the SimpleDateFormat. The default value of the property is "dd.MM.yyyy".
Returns:
Object if validation passed, return toValidate
Throws:
DSETypeException

doubleValidator

public java.lang.Object doubleValidator(java.lang.Object toValidate,
                                        double minValue,
                                        double maxValue)
                                 throws DSETypeException
Validates the object of the Double type and, if successful, returns the object. Otherwise, this method throws an exception. This method first tries to get the parameters required for the validation from the Hashtable passed as an argument. If it does not find the parameters there, the method then tries the descriptor passed as an argument. If the method does not find the parameters in the descriptor, it gets them from the Constants of the type.

Parameters:
toValidate - Object
minValue - A Double representation for the lowest double value allowed for the object. 0 means no limitation
maxValue - A Double representation for the highest double value allowed for the object 0 means no limitation
Returns:
Object if validation passed, return toValidate
Throws:
DSETypeException

floatValidator

public java.lang.Object floatValidator(java.lang.Object toValidate,
                                       float minValue,
                                       float maxValue)
                                throws DSETypeException
Validates the object of the Float type and, if successful, returns the object. Otherwise, this method throws an exception. This method first tries to get the parameters required for the validation from the Hashtable passed as an argument. If it does not find the parameters there, the method then tries the descriptor passed as an argument. If the method does not find the parameters in the descriptor, it gets them from the Constants of the type.

Parameters:
toValidate - Object
minValue - A Float representation for the lowest double value allowed for the object. 0 means no limitation
maxValue - A Float representation for the highest double value allowed for the object 0 means no limitation
Returns:
Object if validation passed, return toValidate
Throws:
DSETypeException

integerValidator

public java.lang.Object integerValidator(java.lang.Object toValidate,
                                         int minValue,
                                         int maxValue)
                                  throws DSETypeException
Validates the object of the Integer type and, if successful, returns the object. Otherwise, this method throws an exception. This method first tries to get the parameters required for the validation from the Hashtable passed as an argument. If it does not find the parameters there, the method then tries the descriptor passed as an argument. If the method does not find the parameters in the descriptor, it gets them from the Constants of the type.

Parameters:
toValidate - Object
minValue - A Int representation for the lowest double value allowed for the object. 0 means no limitation
maxValue - A Int representation for the highest double value allowed for the object 0 means no limitation
Returns:
Object if validation passed, return toValidate
Throws:
DSETypeException

stringValidator

public java.lang.Object stringValidator(java.lang.Object toValidate,
                                        int minLength,
                                        int maxLength)
                                 throws DSETypeException
Validates an object of the String type and, if successful, returns the object. Otherwise, this method throws the appropriate exception. This method first tries to get the parameters required for the validation from the Hashtable passed as an argument. If it does not find the parameters there, the method then tries the descriptor passed as an argument. If the method does not find the parameters in the descriptor, it gets them from the Constants of the type.

Parameters:
toValidate - Object
minLength - A Int representation for the min length allowed for the object. 0 means no limitation
maxLength - A Int representation for the max length allowed for the object. 0 means no limitation
Returns:
Object if validation passed, return toValidate
Throws:
DSETypeException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005