|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.forms.AbstractFormValidator
org.barracudamvc.core.forms.Or
public class Or
This validator ensures that at least one of the given validators is valid, (effectively acting as an "OR" or "||") or a ValidationException will be generated
The sub-validators can be specified as array, list or by using the convenience constructors.
Field Summary | |
---|---|
protected FormValidator[] |
_fv
|
Fields inherited from class org.barracudamvc.core.forms.AbstractFormValidator |
---|
localLogger |
Constructor Summary | |
---|---|
Or(FormValidator[] fv)
Public constructor. |
|
Or(FormValidator[] fv,
String ierrmsg)
Public constructor. |
|
Or(FormValidator fv1,
FormValidator fv2)
Public constructor. |
|
Or(FormValidator fv1,
FormValidator fv2,
FormValidator fv3)
Public constructor. |
|
Or(FormValidator fv1,
FormValidator fv2,
FormValidator fv3,
FormValidator fv4)
Public constructor. |
|
Or(FormValidator fv1,
FormValidator fv2,
FormValidator fv3,
FormValidator fv4,
String ierrmsg)
Public constructor. |
|
Or(FormValidator fv1,
FormValidator fv2,
FormValidator fv3,
String ierrmsg)
Public constructor. |
|
Or(FormValidator fv1,
FormValidator fv2,
String ierrmsg)
Public constructor. |
|
Or(List fv)
Public constructor. |
|
Or(List fv,
String ierrmsg)
Public constructor. |
Method Summary | |
---|---|
FormValidator[] |
getSubValidators()
Return the sub-validators that are or'ed together Do not assume this array is of length 2, in order to allow for future use. |
void |
validate(FormElement element,
FormMap map,
boolean deferExceptions)
Rather than calling all the sub validate methods, we make sure at least one of the sub-validators is valid |
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 |
---|
protected FormValidator[] _fv
Constructor Detail |
---|
public Or(List fv)
fv
- the list of validatorspublic Or(List fv, String ierrmsg)
fv
- the list of validatorsierrmsg
- the message associated with this errorpublic Or(FormValidator[] fv)
fv
- the array of validatorspublic Or(FormValidator[] fv, String ierrmsg)
fv
- the array of validatorsierrmsg
- the message associated with this errorpublic Or(FormValidator fv1, FormValidator fv2)
fv1
- the first subvalidatorfv2
- the second subvalidatorpublic Or(FormValidator fv1, FormValidator fv2, String ierrmsg)
fv1
- the first subvalidatorfv2
- the second subvalidatorierrmsg
- the message associated with this errorpublic Or(FormValidator fv1, FormValidator fv2, FormValidator fv3)
fv1
- the first subvalidatorfv2
- the second subvalidatorfv3
- the third subvalidatorpublic Or(FormValidator fv1, FormValidator fv2, FormValidator fv3, String ierrmsg)
fv1
- the first subvalidatorfv2
- the second subvalidatorfv3
- the third subvalidatorierrmsg
- the message associated with this errorpublic Or(FormValidator fv1, FormValidator fv2, FormValidator fv3, FormValidator fv4)
fv1
- the first subvalidatorfv2
- the second subvalidatorfv3
- the third subvalidatorfv4
- the fourth subvalidatorpublic Or(FormValidator fv1, FormValidator fv2, FormValidator fv3, FormValidator fv4, String ierrmsg)
fv1
- the first subvalidatorfv2
- the second subvalidatorfv3
- the third subvalidatorfv4
- the fourth subvalidatorierrmsg
- the message associated with this errorMethod Detail |
---|
public FormValidator[] getSubValidators()
public void validate(FormElement element, FormMap map, boolean deferExceptions) throws ValidationException
element
- the form element to be validated (null indicates
we want to perform form level validation)map
- 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
ValidationException
- if the element is not valid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |