com.jtri.struts
Class Validations

java.lang.Object
  extended bycom.jtri.struts.Validations

public class Validations
extends java.lang.Object

Extension for Struts validations to support composite names and status. The default struts validation engine only implements client validation for flat properties.

Author:
atorres

Constructor Summary
Validations()
           
 
Method Summary
static java.util.Date validateDateIndexed(java.lang.Object bean, ValidatorAction va, Field field, org.apache.struts.action.ActionMessages errors, Validator validator, javax.servlet.http.HttpServletRequest request)
           
static boolean validateMaskIndexed(java.lang.Object bean, ValidatorAction va, Field field, org.apache.struts.action.ActionMessages errors, Validator validator, javax.servlet.http.HttpServletRequest request)
          Checks if the field matches the regular expression in the field's mask attribute.
static boolean validateMaxLengthIndexed(java.lang.Object bean, ValidatorAction va, Field field, org.apache.struts.action.ActionMessages errors, Validator validator, javax.servlet.http.HttpServletRequest request)
           
static boolean validateMinLengthIndexed(java.lang.Object bean, ValidatorAction va, Field field, org.apache.struts.action.ActionMessages errors, Validator validator, javax.servlet.http.HttpServletRequest request)
           
static boolean validateRequiredIndexed(java.lang.Object bean, ValidatorAction va, Field field, org.apache.struts.action.ActionMessages errors, Validator validator, javax.servlet.http.HttpServletRequest request)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validations

public Validations()
Method Detail

validateRequiredIndexed

public static boolean validateRequiredIndexed(java.lang.Object bean,
                                              ValidatorAction va,
                                              Field field,
                                              org.apache.struts.action.ActionMessages errors,
                                              Validator validator,
                                              javax.servlet.http.HttpServletRequest request)

validateDateIndexed

public static java.util.Date validateDateIndexed(java.lang.Object bean,
                                                 ValidatorAction va,
                                                 Field field,
                                                 org.apache.struts.action.ActionMessages errors,
                                                 Validator validator,
                                                 javax.servlet.http.HttpServletRequest request)

validateMinLengthIndexed

public static boolean validateMinLengthIndexed(java.lang.Object bean,
                                               ValidatorAction va,
                                               Field field,
                                               org.apache.struts.action.ActionMessages errors,
                                               Validator validator,
                                               javax.servlet.http.HttpServletRequest request)

validateMaxLengthIndexed

public static boolean validateMaxLengthIndexed(java.lang.Object bean,
                                               ValidatorAction va,
                                               Field field,
                                               org.apache.struts.action.ActionMessages errors,
                                               Validator validator,
                                               javax.servlet.http.HttpServletRequest request)

validateMaskIndexed

public static boolean validateMaskIndexed(java.lang.Object bean,
                                          ValidatorAction va,
                                          Field field,
                                          org.apache.struts.action.ActionMessages errors,
                                          Validator validator,
                                          javax.servlet.http.HttpServletRequest request)
Checks if the field matches the regular expression in the field's mask attribute.

Parameters:
bean - The bean validation is being performed on.
va - The ValidatorAction that is currently being performed.
field - The Field object associated with the current field being validated.
errors - The ActionMessages object to add errors to if any validation errors occur.
request - Current request object.
Returns:
true if field matches mask, false otherwise.