|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.iscreen.BaseValidator
org.iscreen.validators.DateFormatValidator
public class DateFormatValidator
This validator checks the format of the input String to verify that it conforms to the proper format.
Field Summary | |
---|---|
protected java.lang.String |
displayFormat
|
protected java.lang.String |
format
|
protected boolean |
lenientFlag
|
Fields inherited from class org.iscreen.BaseValidator |
---|
defaultFailure |
Constructor Summary | |
---|---|
DateFormatValidator()
Default constructor. |
Method Summary | |
---|---|
java.lang.String |
getDisplayFormat()
Retrieves the format of the date for display purposes. |
java.lang.String |
getFormat()
Retrieves the date format that the date is validated against. |
void |
setDisplayFormat(java.lang.String theDisplayFormat)
The display format, which is reported when a failure occurs. |
void |
setFormat(java.lang.String theFormat)
The format of the date String. |
void |
setLenient(boolean lenient)
The lenient flag. |
void |
validate(ValidatorContext context,
java.lang.Object beanToValidate)
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 org.iscreen.BaseValidator |
---|
constructBeanToValidate, getDefaultFailure, getStringValue, getValue, setDefaultFailure |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String format
protected java.lang.String displayFormat
protected boolean lenientFlag
Constructor Detail |
---|
public DateFormatValidator()
Method Detail |
---|
public void validate(ValidatorContext context, java.lang.Object beanToValidate)
Validator
context
- The ValidatorContext, which is used to report failures.beanToValidate
- The JavaBean to validate.public void setFormat(java.lang.String theFormat)
theFormat
- The SimpleDateFormat pattern.public java.lang.String getFormat()
public void setDisplayFormat(java.lang.String theDisplayFormat)
theDisplayFormat
- The format to display to the user.public java.lang.String getDisplayFormat()
public void setLenient(boolean lenient)
lenient
- The lenient flag for the SimpleDateFormat.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |