Package org.springframework.format.datetime.standard

# Class TemporalAccessorPrinter

java.lang.Object
org.springframework.format.datetime.standard.TemporalAccessorPrinter

All Implemented Interfaces:
  `Printer<TemporalAccessor>`

public final class TemporalAccessorPrinter extends Object implements Printer<TemporalAccessor>
`Printer` implementation for a JSR-310 `TemporalAccessor`, using a `DateTimeFormatter`) (the contextual one, if available).

Since:
  4.0
Author:
  Juergen Hoeller
See Also:
  - `DateTimeContextHolder.getFormatter(java.time.format.DateTimeFormatter, java.util.Locale)`
  - `DateTimeFormatter.format(java.time.temporal.TemporalAccessor)`

## Constructor Summary

Constructors
Constructor
Description
`TemporalAccessorPrinter(DateTimeFormatter formatter)`
Create a new TemporalAccessorPrinter.

## Method Summary

Modifier and Type
Method
Description
`String`
`print(TemporalAccessor partial, Locale locale)`
Print the object of type T for display.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TemporalAccessorPrinter

public TemporalAccessorPrinter(DateTimeFormatter formatter)
Create a new TemporalAccessorPrinter.

Parameters:
  `formatter` - the base DateTimeFormatter instance

## Method Details

### print

public String print(TemporalAccessor partial, Locale locale)
Description copied from interface: `Printer`
Print the object of type T for display.

Specified by:
  `print` in interface `Printer<TemporalAccessor>`
Parameters:
  `partial` - the instance to print
  `locale` - the current user locale
Returns:
  the printed text string