olg.csv.bean.formatter
Class DateFormatter

Package class diagram package DateFormatter
java.lang.Object
  extended by olg.csv.bean.formatter.Formatter<Date>
      extended by olg.csv.bean.formatter.DateFormatter

public final class DateFormatter
extends Formatter<Date>

Class dedicated in Date formatting.


Field Summary
private  DateFormat dateFormat
          The date format.
 
Constructor Summary
DateFormatter(String pattern)
          Constructs a date formatter with the given pattern and default locale.
DateFormatter(String pattern, Locale locale)
           
 
Method Summary
 String toString(Date date)
          Default implementation based on toString Method of the given t.
 
Methods inherited from class olg.csv.bean.formatter.Formatter
getDateFormatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateFormat

private final DateFormat dateFormat
The date format.

Constructor Detail

DateFormatter

public DateFormatter(String pattern)
Constructs a date formatter with the given pattern and default locale.

Parameters:
pattern - the date pattern. must not be null.

DateFormatter

public DateFormatter(String pattern,
                     Locale locale)
Parameters:
pattern - the date pattern. Must not be null.
locale - the locale. Must not be null.
Method Detail

toString

public String toString(Date date)
Description copied from class: Formatter
Default implementation based on toString Method of the given t.

Overrides:
toString in class Formatter<Date>
Parameters:
date - the value to format.
Returns:
the formatted value.


Copyright © 2014. All Rights Reserved.