public class SimpleDateConstraint extends SimpleConstraint
_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 and Description |
|---|
SimpleDateConstraint(int flags) |
SimpleDateConstraint(int flags,
Date begin,
Date end,
String errmsg)
Constructs a constraint with beginning and ending date.
|
SimpleDateConstraint(int flags,
String errmsg)
Constraints a constraint.
|
SimpleDateConstraint(int flags,
String regex,
String errmsg)
Constructs a constraint combining regular expression.
|
SimpleDateConstraint(String constraint)
Constructs a constraint with a list of constraints separated by comma.
|
SimpleDateConstraint(String regex,
String errmsg)
Constructs a regular-expression constraint.
|
| Modifier and Type | Method and Description |
|---|---|
Date |
getBeginDate()
Returns the beginning date, or null if there is no constraint of
the beginning date.
|
Date |
getEndDate()
Returns the ending date, or null if there is no constraint of
the ending date.
|
protected int |
parseConstraint(String constraint)
Parses a constraint into an integer value.
|
void |
validate(org.zkoss.zk.ui.Component comp,
Object value)
Verifies whether the value is acceptable.
|
getClientConstraint, getClientPackages, getErrorMessage, getFlags, getInstancepublic SimpleDateConstraint(int flags)
public SimpleDateConstraint(int flags,
String errmsg)
flags - a combination of SimpleConstraint.NO_POSITIVE, SimpleConstraint.NO_NEGATIVE,
SimpleConstraint.NO_ZERO, and so on.errmsg - the error message to display. Ignored if null or empty.public SimpleDateConstraint(String regex, String errmsg)
regex - ignored if null or emptyerrmsg - the error message to display. Ignored if null or empty.public SimpleDateConstraint(int flags,
String regex,
String errmsg)
flags - a combination of SimpleConstraint.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.public SimpleDateConstraint(int flags,
Date begin,
Date end,
String errmsg)
flags - a combination of SimpleConstraint.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.public SimpleDateConstraint(String constraint)
constraint - a list of constraints separated by comma.
Example: "between 20071012 and 20071223", "before 20080103"public Date getBeginDate()
public Date getEndDate()
protected int parseConstraint(String constraint) throws org.zkoss.zk.ui.UiException
SimpleConstraintSimpleConstraint.NO_POSITIVE.
Deriving classes might override this to provide more constraints.
parseConstraint in class SimpleConstraintorg.zkoss.zk.ui.UiExceptionpublic void validate(org.zkoss.zk.ui.Component comp,
Object value)
throws org.zkoss.zk.ui.WrongValueException
Constraintvalidate in interface Constraintvalidate in class SimpleConstraintcomp - the component being validatedorg.zkoss.zk.ui.WrongValueExceptionCopyright © 2015. All rights reserved.