au.edu.archer.util
Class XDMSValidator

java.lang.Object
  extended by au.edu.archer.util.XDMSValidator

public class XDMSValidator
extends java.lang.Object

XDMS Validator class.


Constructor Summary
XDMSValidator()
           
 
Method Summary
static java.sql.Timestamp generateDateDDMMYY(java.lang.String date)
          Generate a Timestamp.
static boolean isBlank(java.lang.String str)
          Check whether a String is blank or not (whitespace, null or empty).
static boolean validateDDMMYYDate(java.lang.String date)
          Validate the date with dd/MM/yy format.
static boolean validateEmail(java.lang.String email)
          Validate the email adress.
static boolean validateName(java.lang.String str)
          Validate the name.
static boolean validateSelectOptionsString(java.lang.String str)
          Validate whether a String is a selected dropdown value or not.
static boolean validateStrictName(java.lang.String str)
          Validate the name based on a Strict pattern.
static boolean validateStringNGTFixedLength(java.lang.String str, int length)
          Validate the String length is not great than a fixed length.
static boolean validateStringNotBlankNGTFixedLength(java.lang.String str, int length)
          Validate the String is not blank and not great than a fixed length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDMSValidator

public XDMSValidator()
Method Detail

validateEmail

public static boolean validateEmail(java.lang.String email)
Validate the email adress.

Parameters:
email - The email address.
Returns:
true if it is a valid email address.

validateStringNotBlankNGTFixedLength

public static boolean validateStringNotBlankNGTFixedLength(java.lang.String str,
                                                           int length)
Validate the String is not blank and not great than a fixed length.

Parameters:
str - A String str to be checked.
length - The fixed length.
Returns:
true if a String is not blank and with a fixed length.

validateStringNGTFixedLength

public static boolean validateStringNGTFixedLength(java.lang.String str,
                                                   int length)
Validate the String length is not great than a fixed length.

Parameters:
str - A String to be checked.
length - The fixed length.
Returns:
true if a String is not great than a fixed length.

validateSelectOptionsString

public static boolean validateSelectOptionsString(java.lang.String str)
Validate whether a String is a selected dropdown value or not.

Parameters:
str - A String to be checked.
Returns:
true if A String value is selected from the dropdown values.

isBlank

public static boolean isBlank(java.lang.String str)
Check whether a String is blank or not (whitespace, null or empty).

Parameters:
str - A String to be checked.
Returns:
true if it is not blank.

validateStrictName

public static boolean validateStrictName(java.lang.String str)
Validate the name based on a Strict pattern.

Parameters:
str - A String to be checked
Returns:
true if there is no illegal characters.

validateName

public static boolean validateName(java.lang.String str)
Validate the name.

Parameters:
str - A String to be checked
Returns:
true if there is no illegal characters.

validateDDMMYYDate

public static boolean validateDDMMYYDate(java.lang.String date)
Validate the date with dd/MM/yy format.

Parameters:
date - The date string.
Returns:
true if it is valid date string.

generateDateDDMMYY

public static java.sql.Timestamp generateDateDDMMYY(java.lang.String date)
Generate a Timestamp.

Parameters:
date - The String date.
Returns:
A Timestamp if a String can convert to a valid date.


Copyright © 2008-09 Monash University. All Rights Reserved.