DateTimePrintContext

Context object used during date and time printing. !(p) This class provides a single wrapper to items used _in the format.

@implSpec This class is a mutable context intended for use from a single thread. Usage of the class is thread-safe within standard printing as the framework creates a new instance of the class for each format and printing is single-threaded.

@since 1.8

Constructors

this
this(TemporalAccessor temporal, DateTimeFormatter formatter)

Creates a new instance of the context.

Members

Functions

endOptional
void endOptional()

Ends the printing of an optional segment of the input.

getDecimalStyle
DecimalStyle getDecimalStyle()

Gets the DecimalStyle. !(p) The DecimalStyle controls the localization of numeric output.

getLocale
Locale getLocale()

Gets the locale. !(p) This locale is used to control localization _in the format output except where localization is controlled by the DecimalStyle.

getTemporal
TemporalAccessor getTemporal()

Gets the temporal object being output.

getValue
R getValue(TemporalQuery!(R) query)

Gets a value using a query.

getValue
Long getValue(TemporalField field)

Gets the value of the specified field. !(p) This will return the value for the specified field.

startOptional
void startOptional()

Starts the printing of an optional segment of the input.

toString
string toString()

Returns a string version of the context for debugging.

Meta