org.springframework.format.datetime.standard

## Class TemporalAccessorPrinter

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

- All Implemented Interfaces:
    Printer<java.time.temporal.TemporalAccessor>

      public final class TemporalAccessorPrinter
      extends Object
      implements Printer<java.time.temporal.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 and Description
    `TemporalAccessorPrinter(java.time.format.DateTimeFormatter formatter)` Create a new TemporalAccessorPrinter.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `print(java.time.temporal.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 Detail

    - #### TemporalAccessorPrinter

          public TemporalAccessorPrinter(java.time.format.DateTimeFormatter formatter)

      Create a new TemporalAccessorPrinter.
      Parameters:
        `formatter` - the base DateTimeFormatter instance

  - ### Method Detail

    - #### print

          public String print(java.time.temporal.TemporalAccessor partial,
                              Locale locale)

      Description copied from interface: `Printer`
      Print the object of type T for display.
      Specified by:
        `print` in interface `Printer<java.time.temporal.TemporalAccessor>`
      Parameters:
        `partial` - the instance to print
        `locale` - the current user locale
      Returns:
        the printed text string