com.bankframe.fe.statemachine.ext.validation
Class StandardValidations

java.lang.Object
  extended bycom.bankframe.fe.statemachine.ext.validation.StandardValidations

public final class StandardValidations
extends java.lang.Object

The BFA Standard Validations


Field Summary
static boolean EXACT_LENGTH
           
static boolean EXTACT_LENGTH
           
static boolean MANADATORY
           
static boolean MANDATORY
           
static int NO_LENGTH
          If no maximum length is required use this constant to indicate the fact.
static boolean NOT_EXACT_LENGTH
           
static boolean NOT_EXTACT_LENGTH
           
static boolean NOT_MANADATORY
           
static boolean NOT_MANDATORY
           
 
Constructor Summary
StandardValidations()
           
 
Method Summary
static void validateAttribute(boolean mandatory, boolean exactLength, int minimumLength, int maximumLength, Validate validate, java.lang.Object value, java.lang.String valuesName)
          This method is used to validate an attribute.
static void validateAttribute(boolean mandatory, boolean exactLength, int maximumLength, Validate validate, java.lang.Object value, java.lang.String valuesName)
          This method is used to validate an attribute.
static void validateForLettersDigitsOrWhitespaceOnly(java.lang.String value, java.lang.String valuesName)
          This method validates values letters, digits and whitespace only.
static void validateForMandatory(java.lang.Object value, java.lang.String valuesName)
          This method validates values for mandatory.
static void validateForMandatoryAndForValue(boolean isMandatory, java.lang.String key, java.lang.Object value, java.lang.String valuesName)
          This method validates values for mandatory and validates values against the Constants class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_LENGTH

public static final int NO_LENGTH
If no maximum length is required use this constant to indicate the fact.

See Also:
Constant Field Values

MANDATORY

public static final boolean MANDATORY
See Also:
Constant Field Values

NOT_MANDATORY

public static final boolean NOT_MANDATORY
See Also:
Constant Field Values

EXACT_LENGTH

public static final boolean EXACT_LENGTH
See Also:
Constant Field Values

NOT_EXACT_LENGTH

public static final boolean NOT_EXACT_LENGTH
See Also:
Constant Field Values

MANADATORY

public static final boolean MANADATORY
See Also:
Constant Field Values

NOT_MANADATORY

public static final boolean NOT_MANADATORY
See Also:
Constant Field Values

EXTACT_LENGTH

public static final boolean EXTACT_LENGTH
See Also:
Constant Field Values

NOT_EXTACT_LENGTH

public static final boolean NOT_EXTACT_LENGTH
See Also:
Constant Field Values
Constructor Detail

StandardValidations

public StandardValidations()
Method Detail

validateAttribute

public static void validateAttribute(boolean mandatory,
                                     boolean exactLength,
                                     int minimumLength,
                                     int maximumLength,
                                     Validate validate,
                                     java.lang.Object value,
                                     java.lang.String valuesName)
                              throws ValidationException
This method is used to validate an attribute. If no test is required on the maximum length of an attribute, supply -1 or the NO_LENGTH constant to indicate that the test is not required.

Parameters:
mandatory - boolean
exactLength - boolean
minimumLength - int if the attribute has no minimum length use -1 (StandardValidations.NO_LENGTH) to indicate.
maximumLength - int if the attribute has no maximum length use -1 (StandardValidations.NO_LENGTH) to indicate.
validate - Validate if null then the value will not be validated for certain values.
value - Object to be validated
valuesName - String attribute's name
Throws:
ValidationException - thrown if validation fails.

validateAttribute

public static void validateAttribute(boolean mandatory,
                                     boolean exactLength,
                                     int maximumLength,
                                     Validate validate,
                                     java.lang.Object value,
                                     java.lang.String valuesName)
                              throws ValidationException
This method is used to validate an attribute. If no test is required on the maximum length of an attribute, supply -1 or the NO_LENGTH constant to indicate that the test is not required.

Parameters:
mandatory - boolean
exactLength - boolean
maximumLength - int if the attribute has no maximum length use -1 (StandardValidations.NO_LENGTH) to indicate.
validate - Validate if null then the value will not be validated for certain values.
value - Object to be validated
valuesName - String attribute's name
Throws:
ValidationException - thrown if validation fails.

validateForLettersDigitsOrWhitespaceOnly

public static void validateForLettersDigitsOrWhitespaceOnly(java.lang.String value,
                                                            java.lang.String valuesName)
                                                     throws ValidationException
This method validates values letters, digits and whitespace only.

Parameters:
value - String if null then this test is ignored.
valuesName - String
Throws:
ValidationException

validateForMandatory

public static void validateForMandatory(java.lang.Object value,
                                        java.lang.String valuesName)
                                 throws ValidationException
This method validates values for mandatory. Mandatory fields cannot be null or zero length.

Parameters:
value - Object
valuesName - String
Throws:
ValidationException

validateForMandatoryAndForValue

public static void validateForMandatoryAndForValue(boolean isMandatory,
                                                   java.lang.String key,
                                                   java.lang.Object value,
                                                   java.lang.String valuesName)
                                            throws ValidationException
This method validates values for mandatory and validates values against the Constants class.

Parameters:
key - String if null then this test is ignored.
value - Object if null then this test is ignored.
valuesName - String
Throws:
ValidationException


Copyright © 2005, 2007, Oracle. All rights reserved.