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:
  • 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