org.apache.jetspeed.util
Class ValidationHelper

java.lang.Object
  extended byorg.apache.jetspeed.util.ValidationHelper

public class ValidationHelper
extends java.lang.Object

Data Validation functions using Regex

Version:
$Id: ValidationHelper.java,v 1.4 2004/02/23 03:23:42 jford Exp $
Author:
Ben Woodward, David Sean Taylor

Constructor Summary
ValidationHelper()
           
 
Method Summary
static boolean isAlphaNumeric(java.lang.String evalString, boolean required)
          Tests that the input string contains only alpha numeric or white spaces
static boolean isAlphaNumeric(java.lang.String evalString, boolean required, int maxLength)
           
static boolean isDecimal(java.lang.String evalString, boolean required)
          Tests that the input string contains only numeric
static boolean isDecimal(java.lang.String evalString, boolean required, int maxLength)
           
static boolean isEmailAddress(java.lang.String evalString, boolean required)
          Tests that the input string contains a valid email addess
static boolean isEmailAddress(java.lang.String evalString, boolean required, int maxLength)
           
static boolean isInteger(java.lang.String evalString, boolean required)
          Tests that the input string contains only an integer
static boolean isInteger(java.lang.String evalString, boolean required, int maxLength)
           
static boolean isLooseAlphaNumeric(java.lang.String evalString, boolean required)
           
static boolean isLooseAlphaNumeric(java.lang.String evalString, boolean required, int maxLength)
           
static boolean isTooLong(java.lang.String evalString, int maxLength)
           
static boolean isURL(java.lang.String evalString, boolean required)
          Tests that the input string contains a valid URL
static boolean isURL(java.lang.String evalString, boolean required, int maxLength)
           
static boolean isValidIdentifier(java.lang.String folderName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationHelper

public ValidationHelper()
Method Detail

isAlphaNumeric

public static boolean isAlphaNumeric(java.lang.String evalString,
                                     boolean required)
Tests that the input string contains only alpha numeric or white spaces

Parameters:
evalString - The string that is to be evaluated
required - indicates whether the field is required or not
Returns:
True if the input is alpha numeric, false otherwise.

isAlphaNumeric

public static boolean isAlphaNumeric(java.lang.String evalString,
                                     boolean required,
                                     int maxLength)

isLooseAlphaNumeric

public static boolean isLooseAlphaNumeric(java.lang.String evalString,
                                          boolean required)

isLooseAlphaNumeric

public static boolean isLooseAlphaNumeric(java.lang.String evalString,
                                          boolean required,
                                          int maxLength)

isDecimal

public static boolean isDecimal(java.lang.String evalString,
                                boolean required)
Tests that the input string contains only numeric

Parameters:
evalString - The string that is to be evaluated
Returns:
True if the input is numeric, false otherwise.

isDecimal

public static boolean isDecimal(java.lang.String evalString,
                                boolean required,
                                int maxLength)

isInteger

public static boolean isInteger(java.lang.String evalString,
                                boolean required)
Tests that the input string contains only an integer

Parameters:
evalString - The string that is to be evaluated
Returns:
True if the input is numeric, false otherwise.

isInteger

public static boolean isInteger(java.lang.String evalString,
                                boolean required,
                                int maxLength)

isEmailAddress

public static boolean isEmailAddress(java.lang.String evalString,
                                     boolean required)
Tests that the input string contains a valid email addess

Parameters:
evalString - The string that is to be evaluated
Returns:
True if the input is a valid email address.

isEmailAddress

public static boolean isEmailAddress(java.lang.String evalString,
                                     boolean required,
                                     int maxLength)

isURL

public static boolean isURL(java.lang.String evalString,
                            boolean required)
Tests that the input string contains a valid URL

Parameters:
evalString - The string that is to be evaluated
Returns:
True if the input is a valid URL.

isURL

public static boolean isURL(java.lang.String evalString,
                            boolean required,
                            int maxLength)

isValidIdentifier

public static boolean isValidIdentifier(java.lang.String folderName)

isTooLong

public static boolean isTooLong(java.lang.String evalString,
                                int maxLength)


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.