Package org.zkoss.zul

Class AbstractSimpleDateTimeConstraint<T extends java.lang.Comparable<? super T>>

    • Field Detail

      • _beg

        protected T extends java.lang.Comparable<? super T> _beg
      • _end

        protected T extends java.lang.Comparable<? super T> _end
      • _tzone

        protected java.util.TimeZone _tzone
    • Constructor Detail

      • AbstractSimpleDateTimeConstraint

        public AbstractSimpleDateTimeConstraint​(java.util.regex.Pattern regex,
                                                java.lang.String errmsg)
        Constructs a regular-expression constraint.
        Parameters:
        regex - ignored if null or empty
        errmsg - the error message to display. Ignored if null or empty.
      • AbstractSimpleDateTimeConstraint

        public AbstractSimpleDateTimeConstraint​(int flags,
                                                java.util.regex.Pattern regex,
                                                java.lang.String errmsg)
        Constructs a constraint combining regular expression.
        Parameters:
        flags - a combination of SimpleConstraint.NO_POSITIVE, SimpleConstraint.NO_NEGATIVE, SimpleConstraint.NO_ZERO, and so on.
        regex - ignored if null or empty
        errmsg - the error message to display. Ignored if null or empty.
      • AbstractSimpleDateTimeConstraint

        public AbstractSimpleDateTimeConstraint​(java.lang.String constraint)
        Constructs a constraint with a list of constraints separated by comma.
        Parameters:
        constraint - a list of constraints separated by comma. Example: "between 20071012 and 20071223", "before 20080103"
    • Method Detail

      • fixConstraint

        protected abstract void fixConstraint()
      • getBeginDate

        public T getBeginDate()
        Returns the beginning date, or null if there is no constraint of the beginning date.
      • getEndDate

        public T getEndDate()
        Returns the ending date, or null if there is no constraint of the ending date.
      • setTimeZone

        public void setTimeZone​(java.util.TimeZone tzone)
        Sets time zone that this date constraint belongs to
      • parseConstraint

        protected int parseConstraint​(java.lang.String constraint)
                               throws org.zkoss.zk.ui.UiException
        Description copied from class: SimpleConstraint
        Parses a constraint into an integer value. For example, "no positive" is parsed to SimpleConstraint.NO_POSITIVE.

        Deriving classes might override this to provide more constraints.

        Overrides:
        parseConstraint in class SimpleConstraint
        Throws:
        org.zkoss.zk.ui.UiException
      • parseFrom

        protected abstract T parseFrom​(java.lang.String val)
                                throws org.zkoss.zk.ui.UiException
        Throws:
        org.zkoss.zk.ui.UiException
      • validate

        public void validate​(org.zkoss.zk.ui.Component comp,
                             java.lang.Object value)
                      throws org.zkoss.zk.ui.WrongValueException
        Description copied from interface: Constraint
        Verifies whether the value is acceptable.
        Specified by:
        validate in interface Constraint
        Overrides:
        validate in class SimpleConstraint
        Parameters:
        comp - the component being validated
        Throws:
        org.zkoss.zk.ui.WrongValueException
      • validate0

        protected void validate0​(org.zkoss.zk.ui.Component comp,
                                 T value)
                          throws org.zkoss.zk.ui.WrongValueException
        Throws:
        org.zkoss.zk.ui.WrongValueException
      • valueToString

        protected abstract java.lang.String valueToString​(org.zkoss.zk.ui.Component comp,
                                                          T value)