Package eu.webtoolkit.jwt
Class WTimeValidator
java.lang.Object
eu.webtoolkit.jwt.WValidator
eu.webtoolkit.jwt.WRegExpValidator
eu.webtoolkit.jwt.WTimeValidator
A time validator.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WValidator
WValidator.Result
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newWTimeValidator
.WTimeValidator
(String format) Creates a newWTimeValidator
.WTimeValidator
(String format, WTime bottom, WTime top) Creates a newWTimeValidator
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the lower limit of the valid time range.Returns the validator current format.Returns the time formats used to parse time strings.Returns the message displayed when the input is not a time.Returns the message displayed when time is too early.Returns the message displayed when time is too late.Creates a Javascript object that validates the input.getTop()
Returns the upper limit of the valid time range.void
Sets the lower limit of the valid time range.void
Sets the validator format.void
setFormats
(List<String> formats) Sets the time formats used to parse time strings.void
Sets the message to display when the input is not a time.void
Sets the message to display when the time is earlier than bottom.void
Sets the message to display when the time is later than top.void
Sets the upper limit of the valid time range.Validates the given input.Methods inherited from class eu.webtoolkit.jwt.WRegExpValidator
getFlags, getInvalidNoMatchText, getRegExp, getRegExpPattern, setFlags, setInvalidNoMatchText, setRegExp
Methods inherited from class eu.webtoolkit.jwt.WValidator
getInputFilter, getInvalidBlankText, isMandatory, setInvalidBlankText, setMandatory
-
Constructor Details
-
WTimeValidator
public WTimeValidator()Creates a newWTimeValidator
. -
WTimeValidator
Creates a newWTimeValidator
. -
WTimeValidator
Creates a newWTimeValidator
.The validator will accept only times within the indicated range bottom to top, in the time formate
format
-
-
Method Details
-
setFormat
Sets the validator format. -
getFormat
Returns the validator current format.- Overrides:
getFormat
in classWValidator
-
setFormats
Sets the time formats used to parse time strings. -
getFormats
Returns the time formats used to parse time strings. -
setBottom
Sets the lower limit of the valid time range.The default is a null time constructed using WTime()
-
getBottom
Returns the lower limit of the valid time range. -
setTop
Sets the upper limit of the valid time range.The default is a null time constructed using WTime()
-
getTop
Returns the upper limit of the valid time range. -
setInvalidNotATimeText
Sets the message to display when the input is not a time. -
getInvalidNotATimeText
Returns the message displayed when the input is not a time. -
setInvalidTooEarlyText
Sets the message to display when the time is earlier than bottom. -
getInvalidTooEarlyText
Returns the message displayed when time is too early. -
setInvalidTooLateText
Sets the message to display when the time is later than top. -
getInvalidTooLateText
Returns the message displayed when time is too late. -
validate
Validates the given input.The input is considered valid only when it is blank for a non-mandatory field, or represents a time in the given format, and within the valid range.
- Overrides:
validate
in classWRegExpValidator
-
getJavaScriptValidate
Description copied from class:WValidator
Creates a Javascript object that validates the input.The JavaScript expression should evaluate to an object which contains a
validate(text)
function, which returns an object that contains the following two fields:- fields: a boolean valid,
- a
message
that indicates the problem if not valid.
Returns an empty string if the validator does not provide a client-side validation implementationq.
- Overrides:
getJavaScriptValidate
in classWRegExpValidator
- See Also:
-