Class VTime
java.lang.Object
fc.web.forms.FieldValidator
fc.web.forms.VTime
Validates a time entered in a text box. Typical examples may
look like: 1:23 pm, 1 am, 1:00 am,
and 01:23 pm (with or without "am/pm" as part of the
entered text). By default, all of the above patterns are allowed and
the space between the time and "am/pm" is optional. This can be
changed via the
useAM_PM and allowSpaceBeforeAM_PM(boolean)
methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallowSpaceBeforeAM_PM(boolean allow) voiduseAM_PM(boolean useAM_PM) booleanWorks with any field that returns a String via it'smethod.invalid reference
Field#getValueMethods inherited from class FieldValidator
getErrorMessage, getField
-
Constructor Details
-
VTime
-
-
Method Details
-
useAM_PM
-
allowSpaceBeforeAM_PM
-
validate
Works with any field that returns a String via it'smethod.invalid reference
Field#getValueIf validation succeeds, this method puts the parsed date in the specified form data as the validated value for the target field. This saves the hassle of reparsing the text when (typically) retrieving it later to save the value out to the database.
- Specified by:
validatein classFieldValidator- Throws:
ClassCastException- If the field'smethod does not return a Stringinvalid reference
Field#getValue
-