org.springframework.format.datetime.joda
Class ReadableInstantPrinter

java.lang.Object
  extended by org.springframework.format.datetime.joda.ReadableInstantPrinter
All Implemented Interfaces:
Printer<ReadableInstant>

public final class ReadableInstantPrinter
extends java.lang.Object
implements Printer<ReadableInstant>

Prints JodaTime ReadableInstant instances using a DateTimeFormatter.

Since:
3.0
Author:
Keith Donald

Field Summary
private  DateTimeFormatter formatter
           
 
Constructor Summary
ReadableInstantPrinter(DateTimeFormatter formatter)
          Create a new ReadableInstantPrinter.
 
Method Summary
 java.lang.String print(ReadableInstant instant, java.util.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
 

Field Detail

formatter

private final DateTimeFormatter formatter
Constructor Detail

ReadableInstantPrinter

public ReadableInstantPrinter(DateTimeFormatter formatter)
Create a new ReadableInstantPrinter.

Parameters:
formatter - the Joda DateTimeFormatter instance
Method Detail

print

public java.lang.String print(ReadableInstant instant,
                              java.util.Locale locale)
Description copied from interface: Printer
Print the object of type T for display.

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