|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.iscreen.validators.DateRangeValidator
public class DateRangeValidator
The date range validator checks a "from" date to a "to" date to ensure that the "to" date is equal to or after the "from" date. If not, the "rangeFailure" is reported. In addition, a third check is done if the "date" property is mapped (not null), where if the "date" property is before the "from" date or after the "to" date, then the "betweenFailure" is reported. The mapping properties are: 'to', 'from' and 'date'.
Nested Class Summary | |
---|---|
protected class |
DateRangeValidator.BeanToValidate
|
Constructor Summary | |
---|---|
DateRangeValidator()
Default constructor. |
Method Summary | |
---|---|
java.lang.Object |
constructBeanToValidate()
This is called prior to calling the validate() method. |
void |
setAfterFailure(FailureMessage failure)
|
void |
setBeforeFailure(FailureMessage failure)
|
void |
setRangeFailure(FailureMessage failure)
This is the only failure that this validator reports. |
void |
validate(ValidatorContext context,
java.lang.Object objectToValidate)
This is the method that's called to validate the "bean-to-validate." Use the passed in ValidatorContext to report validation failures, etc. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateRangeValidator()
Method Detail |
---|
public void validate(ValidatorContext context, java.lang.Object objectToValidate)
Validator
validate
in interface Validator
context
- The ValidatorContext, which is used to report failures.objectToValidate
- The JavaBean to validate.public java.lang.Object constructBeanToValidate()
Validator
constructBeanToValidate
in interface Validator
public void setRangeFailure(FailureMessage failure)
failure
- The failure message to report.public void setBeforeFailure(FailureMessage failure)
public void setAfterFailure(FailureMessage failure)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |