org.barracudamvc.core.forms.validators
Class LinkingValidator
java.lang.Object
org.barracudamvc.core.forms.AbstractFormValidator
org.barracudamvc.core.forms.DefaultFormValidator
org.barracudamvc.core.forms.validators.LinkingValidator
- All Implemented Interfaces:
- FormValidator
- public class LinkingValidator
- extends DefaultFormValidator
Ensures that if any element in a list of elements contains a non-null value that all the other
elements also be non-null.
- Since:
- csc_110304_1
- Author:
- christianc@atmreports.com
Constructor Summary |
LinkingValidator(String[] ifields)
Define a LinkingValidator where if any of the fields is non-null, then all the fields
must be non null |
LinkingValidator(String ikeyField,
String[] ifields)
Define a LinkingValidator where a group of fields are required only when a specific "key"
field is not null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
keyField
protected String keyField
fields
protected String[] fields
LinkingValidator
public LinkingValidator(String[] ifields)
- Define a LinkingValidator where if any of the fields is non-null, then all the fields
must be non null
LinkingValidator
public LinkingValidator(String ikeyField,
String[] ifields)
- Define a LinkingValidator where a group of fields are required only when a specific "key"
field is not null.
validateForm
public void validateForm(FormMap map,
boolean deferExceptions)
throws ValidationException
- Description copied from class:
DefaultFormValidator
- Validate an entire FormMap. This is the method developers should
override to provide specific validation for the entire form, as
opposed to validating a specific element within the form.
To indicate a form is invalid, through a ValidationException,
which will interrupt the validation process immediately. If you
want to indicate an error, but would still like validation to
continue (so that you can identify multiple errors in one
validation pass) throw a DeferredValidationException instead.
- Overrides:
validateForm
in class DefaultFormValidator
- Parameters:
map
- the map to be validateddeferExceptions
- 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
_checkFields
protected void _checkFields(FormMap map,
String ikeyField,
String[] ifields,
boolean deferExceptions)
throws ValidationException
- Throws:
ValidationException
Copyright © 2004 BarracudaMVC.org All Rights Reserved.