|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ail.core.validator.CommonsValidatorFunctions
public class CommonsValidatorFunctions
Commons validator functions
| Field Summary | |
|---|---|
static java.lang.String |
FIELD_JOIN_AND
|
static java.lang.String |
FIELD_TEST_DOUBLE
|
static java.lang.String |
FIELD_TEST_EQUAL
|
static java.lang.String |
FIELD_TEST_FLOAT
|
static java.lang.String |
FIELD_TEST_INTEGER
|
static java.lang.String |
FIELD_TEST_NOTNULL
|
static java.lang.String |
FIELD_TEST_NULL
|
static java.lang.String |
FIELD_TEST_SHORT
|
| Constructor Summary | |
|---|---|
CommonsValidatorFunctions()
|
|
| Method Summary | |
|---|---|
static boolean |
validateByte(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field can be successfully converted to a byte. |
static boolean |
validateCreditCard(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field is a credit card. |
static boolean |
validateDate(java.lang.Object bean,
org.apache.commons.validator.Field field,
java.util.Locale locale)
Checks if the field is a date. |
static boolean |
validateDouble(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field can be successfully converted to a double. |
static boolean |
validateEmail(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field is an e-mail address. |
static boolean |
validateFloat(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field can be successfully converted to a float. |
static boolean |
validateInRange(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field is in range. |
static boolean |
validateInt(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field can be successfully converted to a int. |
static boolean |
validateLong(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field can be successfully converted to a long. |
static boolean |
validateMaximumLength(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field is a maximum length. |
static boolean |
validateMinimumLength(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field is a minimum length. |
static boolean |
validateRegexp(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field matches a regular expresion. |
static boolean |
validateRequired(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field is required. |
static boolean |
validateRequiredIf(java.lang.Object bean,
org.apache.commons.validator.Field field,
org.apache.commons.validator.Validator validator)
Validate only if a test is successfull on other fields |
static boolean |
validateShort(java.lang.Object bean,
org.apache.commons.validator.Field field)
Checks if the field can be successfully converted to a short. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FIELD_TEST_DOUBLE
public static final java.lang.String FIELD_TEST_INTEGER
public static final java.lang.String FIELD_TEST_FLOAT
public static final java.lang.String FIELD_TEST_SHORT
public static final java.lang.String FIELD_TEST_NULL
public static final java.lang.String FIELD_TEST_NOTNULL
public static final java.lang.String FIELD_TEST_EQUAL
public static final java.lang.String FIELD_JOIN_AND
| Constructor Detail |
|---|
public CommonsValidatorFunctions()
| Method Detail |
|---|
public static boolean validateRequired(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
null and
has a length greater than zero,
true is returned.
Otherwise false.
throws ValidationError
org.exolab.castor.xml.ValidationException
public static boolean validateMinimumLength(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
null and
has a length greater than the minimum length,
true is returned.
Otherwise false.
throws ValidationException if Minimum length is not a valid integer
org.exolab.castor.xml.ValidationException
public static boolean validateMaximumLength(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
null and
has a length less than the maximum length,
true is returned.
Otherwise false.
throws ValidationException if Maximum length is not a valid integer
org.exolab.castor.xml.ValidationException
public static boolean validateByte(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
byte.
bean - Object with field to validatefield - Field to validate
byte true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateShort(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
short.
bean - Object with field to validatefield - Field to validate
short true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateInt(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
int.
bean - Object with field to validatefield - Field to validate
int true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateLong(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
long.
bean - Object with field to validatefield - Field to validate
long true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateFloat(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
float.
bean - Object with field to validatefield - Field to validate
float true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateDouble(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
double.
bean - Object with field to validatefield - Field to validate
double true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateEmail(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateRegexp(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateCreditCard(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateDate(java.lang.Object bean,
org.apache.commons.validator.Field field,
java.util.Locale locale)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validatelocale - Date locale format if pattern not being tested
true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateInRange(java.lang.Object bean,
org.apache.commons.validator.Field field)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validate
true is returned.
Otherwise false.
throws ValidationException
org.exolab.castor.xml.ValidationException
public static boolean validateRequiredIf(java.lang.Object bean,
org.apache.commons.validator.Field field,
org.apache.commons.validator.Validator validator)
throws org.exolab.castor.xml.ValidationException
bean - Object with field to validatefield - Field to validatevalidator - Validation configuration
null and
has a length greater than zero,
true is returned.
Otherwise false.
Otherwise true is returned.
throws ValidationException
org.exolab.castor.xml.ValidationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||