com.bankframe.validation
Class DataTypeValidator

java.lang.Object
  extended bycom.bankframe.validation.DataTypeValidator

public class DataTypeValidator
extends java.lang.Object

This class provides utility methods for validating data-types


Constructor Summary
DataTypeValidator()
           
 
Method Summary
static boolean isDigitsOnly(java.lang.String value)
          This method checks if the specified String contains only digits.
static boolean isExactLength(java.lang.String value, int length)
          This method checks if the length of the specified string is exactly the required value.
static boolean isLengthGreaterThanOrEqual(java.lang.String value, int minLength)
          This method checks if the length of the specified string is greater than or equal to the specified minimum length.
static boolean isLengthLessThanOrEqual(java.lang.String value, int maxLength)
          This method checks if the length of the specified string is less than or equal to the specified maximum length.
static boolean isLetterOrDigitsOnly(java.lang.String value)
          This method checks if the specified String contains only letters or digits If the value is null or zero length then true is returned
static boolean isLetterOrDigitsOrWhiteSpacesOnly(java.lang.String value)
          This method checks if the specified String contains only letters or digits or white spaces If the value is null or zero length then true is returned
static boolean isLettersOnly(java.lang.String value)
          This method checks if the specified String contains only letters If the value is null or zero length then true is returned
static boolean isNullOrEmpty(java.lang.Object value)
          This method will return true if the value is: null an empty string a string containing: null Otherwise this method will return false
static boolean isNullOrEmpty(java.lang.String value)
          This method will return true if the value is: null an empty string a string containing: null Otherwise this method will return false This method is optimised for String objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeValidator

public DataTypeValidator()
Method Detail

isNullOrEmpty

public static boolean isNullOrEmpty(java.lang.Object value)
This method will return true if the value is:
  1. null
  2. an empty string
  3. a string containing: null
Otherwise this method will return false

Parameters:
value - The Value to test
Returns:
True if the value is null or empty

isNullOrEmpty

public static boolean isNullOrEmpty(java.lang.String value)
This method will return true if the value is:
  1. null
  2. an empty string
  3. a string containing: null
Otherwise this method will return false This method is optimised for String objects.

Parameters:
value - The Value to test
Returns:
True if the value is null or empty

isLengthLessThanOrEqual

public static boolean isLengthLessThanOrEqual(java.lang.String value,
                                              int maxLength)
This method checks if the length of the specified string is less than or equal to the specified maximum length. If the value is null or zero length then true is returned

Parameters:
value - The String to test
maxLength - The maximum valid length
Returns:
True if the string is less than or equal the max value, false otherwise.

isLengthGreaterThanOrEqual

public static boolean isLengthGreaterThanOrEqual(java.lang.String value,
                                                 int minLength)
This method checks if the length of the specified string is greater than or equal to the specified minimum length. If the value is null or zero length then true is returned

Parameters:
value - The String to test
minLength - The minimum valid length
Returns:
True if the string is grester than or equal the min value, false otherwise.

isExactLength

public static boolean isExactLength(java.lang.String value,
                                    int length)
This method checks if the length of the specified string is exactly the required value. If the value is null or zero length then false is returned

Parameters:
value - The String to test
length - The required length
Returns:
True if the string is the exact length, false otherwise

isLetterOrDigitsOnly

public static boolean isLetterOrDigitsOnly(java.lang.String value)
This method checks if the specified String contains only letters or digits If the value is null or zero length then true is returned

Parameters:
value - The String to test
Returns:
True if the string only contains letters or digits

isDigitsOnly

public static boolean isDigitsOnly(java.lang.String value)
This method checks if the specified String contains only digits. If the value is null or zero length then true is returned

Parameters:
value - The String to test
Returns:
True if the string only contains digits

isLettersOnly

public static boolean isLettersOnly(java.lang.String value)
This method checks if the specified String contains only letters If the value is null or zero length then true is returned

Parameters:
value - The String to test
Returns:
True if the string only contains letters

isLetterOrDigitsOrWhiteSpacesOnly

public static boolean isLetterOrDigitsOrWhiteSpacesOnly(java.lang.String value)
This method checks if the specified String contains only letters or digits or white spaces If the value is null or zero length then true is returned

Parameters:
value - The String to test
Returns:
True if the string only contains letters or digits or white spaces


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