org.enhydra.barracuda.core.forms.validators
Class MinLengthValidator
java.lang.Object
org.enhydra.barracuda.core.forms.AbstractFormValidator
org.enhydra.barracuda.core.forms.DefaultFormValidator
org.enhydra.barracuda.core.forms.validators.MinLengthValidator
- All Implemented Interfaces:
- FormValidator
- public class MinLengthValidator
- extends DefaultFormValidator
This validator ensures that the length of a value is >= a minimum length
Field Summary |
protected int |
min
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
min
protected int min
MinLengthValidator
public MinLengthValidator()
- Public no-args constructor.
MinLengthValidator
public MinLengthValidator(int imin)
- Public constructor.
- Parameters:
imin
- the min length
MinLengthValidator
public MinLengthValidator(int imin,
String ierrmsg)
- Public constructor.
- Parameters:
imin
- the min lengthierrmsg
- the message associated with this error
getMinLength
public int getMinLength()
- Get the minimum allowable length
- Returns:
- The minimum allowable length of this field.
validateFormElement
public void validateFormElement(Object val,
FormElement element,
boolean deferExceptions)
throws ValidationException
- Validate a FormElement to make sure the length of element is not
less than a Min length. Validation is not supported for FormType.BOOLEAN
and FormType.DATE
- Overrides:
validateFormElement
in class DefaultFormValidator
- Parameters:
val
- the value to compare the element value toelement
- the form element that contains the val
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 © 2003 BarracudaMVC.org All Rights Reserved.