Package javax.time.calendar.format
Enum Class StrictLenientPrinterParser
- All Implemented Interfaces:
Serializable
,Comparable<StrictLenientPrinterParser>
,Constable
,DateTimeParser
,DateTimePrinter
enum StrictLenientPrinterParser
extends Enum<StrictLenientPrinterParser>
implements DateTimePrinter, DateTimeParser
Enumeration printer/parser to set the strict/lenient parse style.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isPrintDataAvailable
(Calendrical calendrical) Checks if the calendrical contains the data necessary to be printed.int
parse
(DateTimeParseContext context, String parseText, int position) Parses from the supplied text and position into the calendrical.void
print
(Calendrical calendrical, Appendable appendable, DateTimeFormatSymbols symbols) Prints the calendrical object to the appendable.toString()
static StrictLenientPrinterParser
Returns the enum constant of this class with the specified name.static StrictLenientPrinterParser[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRICT
Strict parsing. -
LENIENT
Lenient parsing.
-
-
Constructor Details
-
StrictLenientPrinterParser
private StrictLenientPrinterParser()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isPrintDataAvailable
Checks if the calendrical contains the data necessary to be printed.The implementation should not check the validity of the data, just whether there is sufficient data to attempt a print.
- Specified by:
isPrintDataAvailable
in interfaceDateTimePrinter
- Parameters:
calendrical
- the calendrical to check, not null- Returns:
- true if the calendrical can be printed, false if not
-
print
public void print(Calendrical calendrical, Appendable appendable, DateTimeFormatSymbols symbols) throws IOException Prints the calendrical object to the appendable.- Specified by:
print
in interfaceDateTimePrinter
- Parameters:
calendrical
- the calendrical to print, not nullappendable
- the appendable to add to, not nullsymbols
- the formatting symbols to use, not null- Throws:
IOException
- if the append throws an exception
-
parse
Parses from the supplied text and position into the calendrical.- Specified by:
parse
in interfaceDateTimeParser
- Parameters:
context
- the context to use and parse into, not nullparseText
- the input text to parse, not nullposition
- the position to start parsing at, from 0 to the text length- Returns:
- the new parse position, where negative means an error with the error position encoded using the complement ~ operator
-
toString
- Overrides:
toString
in classEnum<StrictLenientPrinterParser>
-