Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.aendvari.griffin.validation.validators.simple
Class SimpleValidation  view SimpleValidation download SimpleValidation.java

java.lang.Object
  extended bycom.aendvari.griffin.validation.validators.simple.SimpleValidation

public class SimpleValidation
extends java.lang.Object

Several utility functions for validation field values.


Constructor Summary
SimpleValidation()
           
 
Method Summary
static boolean isEmptyString(java.lang.String value)
          Checks that the value is a non-empty string.
static boolean isIntegerWithinRange(java.lang.String value, int min, int max, boolean allowEmpty)
          Checks that the value is a valid integer and is within the specified range.
static boolean isValidDateDDMMYY(java.lang.String value, boolean allowEmpty)
          Checks that the value is a valid date (dd/mm/yy).
static boolean isValidDateMMDDYYYY(java.lang.String value, boolean allowEmpty)
          Checks that the value is a valid date (mm/dd/yyyy).
static boolean isValidDateYYYYMMDD(java.lang.String value, boolean allowEmpty)
          Checks that the value is a valid date (yyyy/mm/dd).
static boolean isValidEmail(java.lang.String value, boolean allowEmpty)
          Checks that the value is a valid email address.
static boolean isValidEmail(java.lang.String value, int max, boolean allowEmpty)
          Checks that the value is a valid email address.
static boolean isValidInteger(java.lang.String value, boolean allowEmpty)
          Checks that the value is a valid integer.
static boolean isValidInteger(java.lang.String value, int digits, boolean allowEmpty)
          Checks that the value is a valid integer that does not exceed the specified number of digits.
static boolean isValidNumber(java.lang.String value, int precision, int scale, boolean allowEmpty)
          Checks that the value is a valid number.
static boolean isValidString(java.lang.String value, int max, boolean allowEmpty)
          Checks that the value is a valid string.
static boolean isValidString(java.lang.String value, int min, int max, boolean allowEmpty)
          Checks that the value is a valid string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleValidation

public SimpleValidation()
Method Detail

isEmptyString

public static boolean isEmptyString(java.lang.String value)
Checks that the value is a non-empty string.


isValidString

public static boolean isValidString(java.lang.String value,
                                    int max,
                                    boolean allowEmpty)
Checks that the value is a valid string. A valid string has at most 'max' characters. Whether empty strings are considered valid is specified by 'allowEmpty'.


isValidString

public static boolean isValidString(java.lang.String value,
                                    int min,
                                    int max,
                                    boolean allowEmpty)
Checks that the value is a valid string. A valid string has at least 'min' characters and at most 'max' characters. Whether empty strings are considered valid is specified by 'allowEmpty'.


isValidEmail

public static boolean isValidEmail(java.lang.String value,
                                   boolean allowEmpty)
Checks that the value is a valid email address. A valid email address must be non-empty, have a '@' and at least one '.'. Whether empty strings are considered valid is specified by 'allowEmpty'.


isValidEmail

public static boolean isValidEmail(java.lang.String value,
                                   int max,
                                   boolean allowEmpty)
Checks that the value is a valid email address. A valid email address must be non-empty, have a '@', at least one '.', and have a maximum of 'max' characters. Whether empty strings are considered valid is specified by 'allowEmpty'.


isValidNumber

public static boolean isValidNumber(java.lang.String value,
                                    int precision,
                                    int scale,
                                    boolean allowEmpty)
Checks that the value is a valid number.


isValidInteger

public static boolean isValidInteger(java.lang.String value,
                                     boolean allowEmpty)
Checks that the value is a valid integer.


isValidInteger

public static boolean isValidInteger(java.lang.String value,
                                     int digits,
                                     boolean allowEmpty)
Checks that the value is a valid integer that does not exceed the specified number of digits.


isIntegerWithinRange

public static boolean isIntegerWithinRange(java.lang.String value,
                                           int min,
                                           int max,
                                           boolean allowEmpty)
Checks that the value is a valid integer and is within the specified range.


isValidDateMMDDYYYY

public static boolean isValidDateMMDDYYYY(java.lang.String value,
                                          boolean allowEmpty)
Checks that the value is a valid date (mm/dd/yyyy).


isValidDateDDMMYY

public static boolean isValidDateDDMMYY(java.lang.String value,
                                        boolean allowEmpty)
Checks that the value is a valid date (dd/mm/yy).


isValidDateYYYYMMDD

public static boolean isValidDateYYYYMMDD(java.lang.String value,
                                          boolean allowEmpty)
Checks that the value is a valid date (yyyy/mm/dd).