Package org.zkoss.zul
Class SimpleLocalTimeConstraint
- All Implemented Interfaces:
Serializable,ClientConstraint,Constraint
A simple
LocalTime constraint.
The time format is HHmmss (24-hour clock system, ISO 8601).- Since:
- 9.0.0
- Author:
- rudyhuang
- See Also:
-
Field Summary
Fields inherited from class org.zkoss.zul.AbstractSimpleDateTimeConstraint
_beg, _end, _tzoneFields inherited from class org.zkoss.zul.SimpleConstraint
_finishParseCst, _flags, AFTER_END, AFTER_POINTER, AFTER_START, AT_POINTER, BEFORE_END, BEFORE_START, END_AFTER, END_BEFORE, NO_EMPTY, NO_FUTURE, NO_NEGATIVE, NO_PAST, NO_POSITIVE, NO_TODAY, NO_ZERO, OVERLAP, OVERLAP_AFTER, OVERLAP_BEFORE, OVERLAP_END, SERVER, START_AFTER, START_BEFORE, STRICT -
Constructor Summary
ConstructorsConstructorDescriptionSimpleLocalTimeConstraint(int flags) Constraints a constraint.SimpleLocalTimeConstraint(int flags, String errmsg) Constraints a constraint.SimpleLocalTimeConstraint(int flags, LocalTime begin, LocalTime end, String errmsg) Constructs a constraint with beginning and ending date.SimpleLocalTimeConstraint(int flags, Pattern regex, String errmsg) Constructs a constraint combining regular expression.SimpleLocalTimeConstraint(String constraint) Constructs a constraint with a list of constraints separated by comma.SimpleLocalTimeConstraint(Pattern regex, String errmsg) Constructs a regular-expression constraint. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected LocalTimevoidVerifies whether the value is acceptable.protected StringvalueToString(org.zkoss.zk.ui.Component comp, LocalTime value) Methods inherited from class org.zkoss.zul.AbstractSimpleDateTimeConstraint
getBeginDate, getEndDate, parseConstraint, setTimeZone, validate0Methods inherited from class org.zkoss.zul.SimpleConstraint
getClientConstraint, getClientPackages, getErrorMessage, getFlags, getInstance, getRawValue
-
Constructor Details
-
SimpleLocalTimeConstraint
public SimpleLocalTimeConstraint(int flags) Constraints a constraint.- Parameters:
flags- a combination ofSimpleConstraint.NO_POSITIVE,SimpleConstraint.NO_NEGATIVE,SimpleConstraint.NO_ZERO, and so on.
-
SimpleLocalTimeConstraint
Constraints a constraint.- Parameters:
flags- a combination ofSimpleConstraint.NO_POSITIVE,SimpleConstraint.NO_NEGATIVE,SimpleConstraint.NO_ZERO, and so on.errmsg- the error message to display. Ignored if null or empty.
-
SimpleLocalTimeConstraint
Constructs a regular-expression constraint.- Parameters:
regex- ignored if null or emptyerrmsg- the error message to display. Ignored if null or empty.
-
SimpleLocalTimeConstraint
Constructs a constraint combining regular expression.- Parameters:
flags- a combination ofSimpleConstraint.NO_POSITIVE,SimpleConstraint.NO_NEGATIVE,SimpleConstraint.NO_ZERO, and so on.regex- ignored if null or emptyerrmsg- the error message to display. Ignored if null or empty.
-
SimpleLocalTimeConstraint
Constructs a constraint with beginning and ending date.- Parameters:
flags- a combination ofSimpleConstraint.NO_POSITIVE,SimpleConstraint.NO_NEGATIVE,SimpleConstraint.NO_ZERO, and so on.begin- the beginning date, or null if no constraint at the beginning date.end- the ending date, or null if no constraint at the ending date.errmsg- the error message to display. Ignored if null or empty.
-
SimpleLocalTimeConstraint
Constructs a constraint with a list of constraints separated by comma.- Parameters:
constraint- a list of constraints separated by comma. Example: between 093000 and 183000, before 210000
-
-
Method Details
-
fixConstraint
protected void fixConstraint()- Specified by:
fixConstraintin classAbstractSimpleDateTimeConstraint<LocalTime>
-
validate
public void validate(org.zkoss.zk.ui.Component comp, Object value) throws org.zkoss.zk.ui.WrongValueException Description copied from interface:ConstraintVerifies whether the value is acceptable.- Specified by:
validatein interfaceConstraint- Overrides:
validatein classAbstractSimpleDateTimeConstraint<LocalTime>- Parameters:
comp- the component being validated- Throws:
org.zkoss.zk.ui.WrongValueException
-
parseFrom
- Specified by:
parseFromin classAbstractSimpleDateTimeConstraint<LocalTime>- Throws:
org.zkoss.zk.ui.UiException
-
valueToString
- Specified by:
valueToStringin classAbstractSimpleDateTimeConstraint<LocalTime>
-