Interface DateTimePrinter
- All Known Implementing Classes:
CaseSensitivePrinterParser, CharLiteralPrinterParser, CompositePrinterParser, FractionPrinterParser, LocalizedPrinterParser, NumberPrinterParser, PadPrinterParserDecorator, ReducedPrinterParser, StrictLenientPrinterParser, StringLiteralPrinterParser, TextPrinterParser, ZoneOffsetPrinterParser, ZonePrinterParser
public interface DateTimePrinter
Strategy for printing a calendrical to an appendable.
The printer may print any part, or the whole, of the input Calendrical. Typically, a complete print is constructed from a number of smaller units, each outputting a single field.
DateTimePrinter is an interface and must be implemented with care to ensure other classes in the framework operate correctly. All instantiable implementations must be final, immutable and thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisPrintDataAvailable(Calendrical calendrical) Checks if the calendrical contains the data necessary to be printed.voidprint(Calendrical calendrical, Appendable appendable, DateTimeFormatSymbols symbols) Prints the calendrical object to the appendable.
-
Method Details
-
print
void print(Calendrical calendrical, Appendable appendable, DateTimeFormatSymbols symbols) throws IOException Prints the calendrical object to the appendable.- Parameters:
calendrical- the calendrical to print, not nullappendable- the appendable to add to, not nullsymbols- the formatting symbols to use, not null- Throws:
CalendricalPrintException- if the date time cannot be printed successfullyIOException- if the append throws an exception
-
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.
- Parameters:
calendrical- the calendrical to check, not null- Returns:
- true if the calendrical can be printed, false if not
-