Package org.zkoss.zul

## Class SimpleLocalDateConstraint

- java.lang.Object
- - org.zkoss.zul.SimpleConstraint
  - - org.zkoss.zul.AbstractSimpleDateTimeConstraint<java.time.LocalDate>
    - - org.zkoss.zul.SimpleLocalDateConstraint

- All Implemented Interfaces:
    `java.io.Serializable`, `ClientConstraint`, `Constraint`

      public class SimpleLocalDateConstraint
      extends AbstractSimpleDateTimeConstraint<java.time.LocalDate>

  A simple `LocalDate` constraint.
  Since:
    9.0.0
  Author:
    rudyhuang
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.zkoss.zul.AbstractSimpleDateTimeConstraint

      `_beg, _end, _tzone`

    - ### Fields 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

    Constructors
    Constructor | Description
    --- | ---
    `SimpleLocalDateConstraint​(int flags)` | Constraints a constraint.
    `SimpleLocalDateConstraint​(int flags, java.lang.String errmsg)` | Constraints a constraint.
    `SimpleLocalDateConstraint​(int flags, java.time.LocalDate begin, java.time.LocalDate end, java.lang.String errmsg)` | Constructs a constraint with beginning and ending date.
    `SimpleLocalDateConstraint​(int flags, java.util.regex.Pattern regex, java.lang.String errmsg)` | Constructs a constraint combining regular expression.
    `SimpleLocalDateConstraint​(java.lang.String constraint)` | Constructs a constraint with a list of constraints separated by comma.
    `SimpleLocalDateConstraint​(java.util.regex.Pattern regex, java.lang.String errmsg)` | Constructs a regular-expression constraint.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `fixConstraint()` |
    `protected java.time.LocalDate` | `parseFrom​(java.lang.String val)` |
    `void` | `validate​(Component comp, java.lang.Object value)` | Verifies whether the value is acceptable.
    `protected java.lang.String` | `valueToString​(Component comp, java.time.LocalDate value)` |

    - ### Methods inherited from class org.zkoss.zul.AbstractSimpleDateTimeConstraint

      `getBeginDate, getEndDate, parseConstraint, setTimeZone, validate0`

    - ### Methods inherited from class org.zkoss.zul.SimpleConstraint

      `getClientConstraint, getClientPackages, getErrorMessage, getFlags, getInstance, getRawValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleLocalDateConstraint

          public SimpleLocalDateConstraint​(int flags)

      Constraints a constraint.
      Parameters:
        `flags` - a combination of `SimpleConstraint.NO_POSITIVE`, `SimpleConstraint.NO_NEGATIVE`, `SimpleConstraint.NO_ZERO`, and so on.

    - #### SimpleLocalDateConstraint

          public SimpleLocalDateConstraint​(int flags,
                                           java.lang.String errmsg)

      Constraints a constraint.
      Parameters:
        `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.

    - #### SimpleLocalDateConstraint

          public SimpleLocalDateConstraint​(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.

    - #### SimpleLocalDateConstraint

          public SimpleLocalDateConstraint​(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.

    - #### SimpleLocalDateConstraint

          public SimpleLocalDateConstraint​(int flags,
                                           java.time.LocalDate begin,
                                           java.time.LocalDate end,
                                           java.lang.String errmsg)

      Constructs a constraint with beginning and ending date.
      Parameters:
        `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.

    - #### SimpleLocalDateConstraint

          public SimpleLocalDateConstraint​(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 void fixConstraint()

      Specified by:
        `fixConstraint` in class `AbstractSimpleDateTimeConstraint<java.time.LocalDate>`

    - #### validate

          public void validate​(Component comp,
                               java.lang.Object value)
                        throws WrongValueException

      Description copied from interface: `Constraint`
      Verifies whether the value is acceptable.
      Specified by:
        `validate` in interface `Constraint`
      Overrides:
        `validate` in class `AbstractSimpleDateTimeConstraint<java.time.LocalDate>`
      Parameters:
        `comp` - the component being validated
      Throws:
        `WrongValueException`

    - #### parseFrom

          protected java.time.LocalDate parseFrom​(java.lang.String val)
                                           throws UiException

      Specified by:
        `parseFrom` in class `AbstractSimpleDateTimeConstraint<java.time.LocalDate>`
      Throws:
        `UiException`

    - #### valueToString

          protected java.lang.String valueToString​(Component comp,
                                                   java.time.LocalDate value)

      Specified by:
        `valueToString` in class `AbstractSimpleDateTimeConstraint<java.time.LocalDate>`