public enum Leniency extends Enum<Leniency>
Defines how lenient parsing of chronological texts should be.
| Enum Constant and Description |
|---|
LAX
The parsed data will be interpreted without any consistency
check or validation of range limits.
|
SMART
This default mode tries to be a compromise between a pedantic
and a lax strategy by paying attention to value range constraints
but neglecting some constraintes like the width of numerical
elements.
|
STRICT
Ensures that all range limits and other validity constraints will
be strictly controlled.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isLax()
Is this leniency mode lax?
|
boolean |
isSmart()
Is this leniency mode smart?
|
boolean |
isStrict()
Is this leniency mode strict?
|
static Leniency |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Leniency[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Leniency STRICT
Ensures that all range limits and other validity constraints will be strictly controlled.
Exceeding the possibly context-dependent range of an element value will always throw an exception.
A consistency check will be performed, too. That means all parsed informations must be consistent (for example the right weekday for a given calendar date). In parsing, the given limits for minimum and maximum count of chars to be interpreted will be checked, too.
public static final Leniency SMART
This default mode tries to be a compromise between a pedantic and a lax strategy by paying attention to value range constraints but neglecting some constraintes like the width of numerical elements.
There is no consistency check like in strict mode. For example a wrong weekday will be ignored and the calendar date will just be interpreted on the base of year, month and day of month.
public static final Leniency LAX
The parsed data will be interpreted without any consistency check or validation of range limits.
This mode even tolerates values like the wall time "T25:00" or the invalid calendar date "2014-02-31" which will be interpreted with the suitable day overflow as "2014-03-03".
public static Leniency[] values()
for (Leniency c : Leniency.values()) System.out.println(c);
public static Leniency valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isStrict()
Is this leniency mode strict?
public boolean isSmart()
Is this leniency mode smart?
public boolean isLax()
Is this leniency mode lax?
Copyright © 2014. All rights reserved.