| java.lang.Object org.andromda.cartridges.jsf.validator.ParameterChecks
ParameterChecks | public class ParameterChecks implements Serializable(Code) | |
This class contains the default validations that are used in the
validator-rules.xml file.
In general passing in a null or blank will return a null Object or a false
boolean. However, nulls and blanks do not result in an error being added to
the errors.
|
Method Summary | |
public static void | validateByte(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field can safely be converted to a byte primitive. | public static void | validateCreditCard(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field is a valid credit card number. | public static void | validateDate(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field is a valid date. | public static void | validateDouble(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field can safely be converted to a double primitive. | public static void | validateDoubleRange(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if a fields value is within a range (min & max specified in
the vars attribute). | public static void | validateEmail(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if a field has a valid exception-mail address. | public static void | validateEqual(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field's value is equal to another field's value on the same form. | public static void | validateFloat(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field can safely be converted to a float primitive. | public static void | validateFloatRange(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if a fields value is within a range (min & max specified in
the vars attribute). | public static void | validateInteger(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field can safely be converted to an int primitive. | public static void | validateLong(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field can safely be converted to a long primitive. | public static void | validateLongRange(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if a fields value is within a range (min & max specified in
the vars attribute). | public static void | validateMask(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the parameter matches the regular expression in the field's
mask attribute. | public static void | validateMaxLength(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field's length is less than or equal to the maximum value. | public static void | validateMinLength(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field's length is greater than or equal to the minimum
value. | public static void | validateRequired(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field isn't null and length of the field is greater than
zero not including whitespace. | public static void | validateRequiredIf(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the parameter isn't null based on the values of other fields. | public static void | validateShort(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field can safely be converted to a short primitive. | public static void | validateTime(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field) Checks if the field is a valid time. | public static void | validateUrl(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)
Validates whether the URL string passed in is a valid URL or not. |
FIELD_TEST_EQUAL | final public static String FIELD_TEST_EQUAL(Code) | | |
FIELD_TEST_NOTNULL | final public static String FIELD_TEST_NOTNULL(Code) | | |
FIELD_TEST_NULL | final public static String FIELD_TEST_NULL(Code) | | |
validateByte | public static void validateByte(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field can safely be converted to a byte primitive.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateCreditCard | public static void validateCreditCard(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field is a valid credit card number.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateDate | public static void validateDate(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field is a valid date. If the field has a datePattern
variable, that will be used to format
java.text.SimpleDateFormat . If the field has a
datePatternStrict variable, that will be used to format
java.text.SimpleDateFormat and the length will be checked
so '2/12/1999' will not pass validation with the format 'MM/dd/yyyy'
because the month isn't two digits. If no datePattern variable is
specified, then the field gets the DateFormat.SHORT format for the
locale. The setLenient method is set to false for all
variations. If the object is a date instance, then validation is not performed.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateDouble | public static void validateDouble(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field can safely be converted to a double primitive.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateDoubleRange | public static void validateDoubleRange(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if a fields value is within a range (min & max specified in
the vars attribute).
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateEmail | public static void validateEmail(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if a field has a valid exception-mail address.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateEqual | public static void validateEqual(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field's value is equal to another field's value on the same form.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateFloat | public static void validateFloat(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field can safely be converted to a float primitive.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateFloatRange | public static void validateFloatRange(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if a fields value is within a range (min & max specified in
the vars attribute).
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateInteger | public static void validateInteger(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field can safely be converted to an int primitive.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateLong | public static void validateLong(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field can safely be converted to a long primitive.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateLongRange | public static void validateLongRange(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if a fields value is within a range (min & max specified in
the vars attribute).
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateMask | public static void validateMask(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the parameter matches the regular expression in the field's
mask attribute.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateMaxLength | public static void validateMaxLength(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field's length is less than or equal to the maximum value.
A Null will be considered an error.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateMinLength | public static void validateMinLength(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field's length is greater than or equal to the minimum
value. A Null will be considered an error.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateRequired | public static void validateRequired(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field isn't null and length of the field is greater than
zero not including whitespace.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateRequiredIf | public static void validateRequiredIf(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the parameter isn't null based on the values of other fields.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateShort | public static void validateShort(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field can safely be converted to a short primitive.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateTime | public static void validateTime(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | | Checks if the field is a valid time. If the field has a timePattern variable,
that will be used to format java.text.SimpleDateFormat .
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
validateUrl | public static void validateUrl(FacesContext context, Object object, Map parameters, Collection errors, ValidatorAction action, Field field)(Code) | |
Validates whether the URL string passed in is a valid URL or not. Does
this by attempting to construct a java.net.URL instance and checking
whether or not, it's valid.
Parameters: context - the faces context Parameters: object - the value of the field being validated. Parameters: parameters - Any field parameters from the validation.xml. Parameters: errors - The Map object to add errors to if anyvalidation errors occur. Parameters: action - The ValidatorAction that is currently beingperformed. Parameters: field - The Field object associated with the currentfield being validated. |
|
|