jdk/src/share/classes/java/time/format/ResolverStyle.java
changeset 17474 8c100beabcc0
parent 16852 60207b2b4b42
equal deleted inserted replaced
17473:35cd9b3a98ff 17474:8c100beabcc0
    67  * Parsing a text string occurs in two phases.
    67  * Parsing a text string occurs in two phases.
    68  * Phase 1 is a basic text parse according to the fields added to the builder.
    68  * Phase 1 is a basic text parse according to the fields added to the builder.
    69  * Phase 2 resolves the parsed field-value pairs into date and/or time objects.
    69  * Phase 2 resolves the parsed field-value pairs into date and/or time objects.
    70  * This style is used to control how phase 2, resolving, happens.
    70  * This style is used to control how phase 2, resolving, happens.
    71  *
    71  *
    72  * <h3>Specification for implementors</h3>
    72  * @implSpec
    73  * This is an immutable and thread-safe enum.
    73  * This is an immutable and thread-safe enum.
    74  *
    74  *
    75  * @since 1.8
    75  * @since 1.8
    76  */
    76  */
    77 public enum ResolverStyle {
    77 public enum ResolverStyle {
    94      * Using smart resolution will perform the sensible default for each
    94      * Using smart resolution will perform the sensible default for each
    95      * field, which may be the same as strict, the same as lenient, or a third
    95      * field, which may be the same as strict, the same as lenient, or a third
    96      * behavior. Individual fields will interpret this differently.
    96      * behavior. Individual fields will interpret this differently.
    97      * <p>
    97      * <p>
    98      * For example, resolving year-month and day-of-month in the ISO calendar
    98      * For example, resolving year-month and day-of-month in the ISO calendar
    99      * system using smart mode will ensure that the day-of-month is valid
    99      * system using smart mode will ensure that the day-of-month is from
   100      * for the year-month, rejecting invalid values, with the exception that
   100      * 1 to 31, converting any value beyond the last valid day-of-month to be
   101      * February 29th in a year other than a leap year will be converted to
   101      * the last valid day-of-month.
   102      * February 28th.
       
   103      */
   102      */
   104     SMART,
   103     SMART,
   105     /**
   104     /**
   106      * Style to resolve dates and times leniently.
   105      * Style to resolve dates and times leniently.
   107      * <p>
   106      * <p>
   108      * Using lenient resolution will resolve the values in an appropriate
   107      * Using lenient resolution will resolve the values in an appropriate
   109      * lenient manner. Individual fields will interpret this differently.
   108      * lenient manner. Individual fields will interpret this differently.
   110      * <p>
   109      * <p>
   111      * For example, lenient mode allows the month in the ISO calendar system
   110      * For example, lenient mode allows the month in the ISO calendar system
   112      * to be outside the range 1 to 12.
   111      * to be outside the range 1 to 12.
       
   112      * For example, month 15 is treated as being 3 months after month 12.
   113      */
   113      */
   114     LENIENT;
   114     LENIENT;
   115 
   115 
   116 }
   116 }