Class WTimeValidator
- See Also:
-
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.Returns the message displayed when the time increment is invalid.Creates a Javascript object that validates the input.getStep()Returns the step (in seconds) between two valid values.getTop()Returns the upper limit of the valid time range.voidSets the lower limit of the valid time range.voidSets the validator format.voidsetFormats(List<String> formats) Sets the time formats used to parse time strings.voidSets the message to display when the input is not a time.voidSets the message to display when the time is earlier than bottom.voidSets the message to display when the time is later than top.voidSets the message to display when the time increment is invalid.voidSets the step (in seconds) between two valid values.voidSets 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, setRegExpMethods 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:
getFormatin 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. -
setStep
Sets the step (in seconds) between two valid values.The default value is 0 seconds, meaning any step is accepted.
When the native HTML5 control is used, this sets the step to 1 or 60 automatically, denepding on the format, respectively HH:mm, or HH:mm:ss. Changing this value has no effect.
-
getStep
Returns the step (in seconds) between two valid values. -
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. -
setInvalidWrongStepText
Sets the message to display when the time increment is invalid. -
getInvalidWrongStepText
Returns the message displayed when the time increment is invalid. -
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:
validatein classWRegExpValidator
-
getJavaScriptValidate
Description copied from class:WValidatorCreates 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
messagethat indicates the problem if not valid.
Returns an empty string if the validator does not provide a client-side validation implementationq.
- Overrides:
getJavaScriptValidatein classWRegExpValidator- See Also:
-