olg.csv.bean.formatter
Class Formatter<T>

Package class diagram package Formatter
java.lang.Object
  extended by olg.csv.bean.formatter.Formatter<T>
Type Parameters:
T - the class the formatter is responsible to transform.
Direct Known Subclasses:
ArrayFormatter, DateFormatter, ODSReader.ODSCellFormatter

public class Formatter<T>
extends Object

Allows to represent an object as a String.


Constructor Summary
Formatter()
           
 
Method Summary
static Formatter<Date> getDateFormatter(String pattern, Locale locale)
          Returns a new instance of a formatter specialized in formatting Date as String.
 String toString(T t)
          Default implementation based on toString Method of the given t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Formatter

public Formatter()
Method Detail

toString

public String toString(T t)
Default implementation based on toString Method of the given t.

Parameters:
t - the value to format.
Returns:
the formatted value.

getDateFormatter

public static Formatter<Date> getDateFormatter(String pattern,
                                               Locale locale)
Returns a new instance of a formatter specialized in formatting Date as String.

Parameters:
pattern - pattern. Must be a not null and valid Date pattern.
locale - the locale to used in date formatting.
Returns:
the Date formatter.


Copyright © 2014. All Rights Reserved.