org.barracudamvc.core.forms.validators
Class ListValidator

java.lang.Object
  extended byorg.barracudamvc.core.forms.AbstractFormValidator
      extended byorg.barracudamvc.core.forms.validators.ListValidator
All Implemented Interfaces:
FormValidator

public class ListValidator
extends AbstractFormValidator

This validator validates all items even if OrigVal is an instance of java.util.List

Author:
Iman L Crawford (icrawford@greatnation.com)

Field Summary
protected  FormValidator fv
           
 
Fields inherited from class org.barracudamvc.core.forms.AbstractFormValidator
localLogger
 
Constructor Summary
ListValidator(FormValidator ifv)
          Public constructor.
ListValidator(FormValidator ifv, String ierrmsg)
          Public constructor.
 
Method Summary
 FormValidator getSubValidator()
          Return the value that is being not'ed
 void validate(FormElement element, FormMap formMap, boolean deferExceptions)
          Will check origVal's type and loop through all the values calling the subValidator.
 
Methods inherited from class org.barracudamvc.core.forms.AbstractFormValidator
generateException, getErrorMessage, isNull, setErrorMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fv

protected FormValidator fv
Constructor Detail

ListValidator

public ListValidator(FormValidator ifv)
Public constructor.

Parameters:
ifv - the validator we wish to make sure is not valid

ListValidator

public ListValidator(FormValidator ifv,
                     String ierrmsg)
Public constructor.

Parameters:
ifv - the validator we wish to make sure is not valid
ierrmsg - the message associated with this error
Method Detail

getSubValidator

public FormValidator getSubValidator()
Return the value that is being not'ed

Returns:
The form element to negate

validate

public void validate(FormElement element,
                     FormMap formMap,
                     boolean deferExceptions)
              throws ValidationException
Will check origVal's type and loop through all the values calling the subValidator.

Parameters:
element - the form element to be validated (null indicates we want to perform form level validation)
formMap - the map to which the element belongs (sometimes necessary to validate elements by comparing them with other elements)
deferExceptions - do we want to deferValidation exceptions and attempt to validate all elements so that we can process all the exceptions at once
Throws:
ValidationException - if the element is not valid


Copyright © 2004 BarracudaMVC.org All Rights Reserved.