Class ReadableInstantPrinter
- java.lang.Object
- org.springframework.format.datetime.joda.ReadableInstantPrinter
- All Implemented Interfaces:
Printer<ReadableInstant>
public final class ReadableInstantPrinter extends Object implements Printer<ReadableInstant>
Prints Joda-TimeReadableInstantinstances using aDateTimeFormatter.- Since:
- 3.0
- Author:
- Keith Donald
Constructor Summary
Constructors Constructor Description ReadableInstantPrinter(DateTimeFormatter formatter)Create a new ReadableInstantPrinter.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringprint(ReadableInstant instant, Locale locale)Print the object of type T for display.
Constructor Detail
ReadableInstantPrinter
public ReadableInstantPrinter(DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.- Parameters:
formatter- the Joda DateTimeFormatter instance
Method Detail
print
public String print(ReadableInstant instant, Locale locale)
Description copied from interface:PrinterPrint the object of type T for display.- Specified by:
printin interfacePrinter<ReadableInstant>- Parameters:
instant- the instance to printlocale- the current user locale- Returns:
- the printed text string