net.lessy.util.format.impl
Class FormatDate

java.lang.Object
  extended by net.lessy.util.format.impl.FormatDate
All Implemented Interfaces:
FormatIF<Date>
Direct Known Subclasses:
FormatTime

public class FormatDate
extends Object
implements FormatIF<Date>

Implementation of a date formatter.

Author:
hl

Constructor Summary
FormatDate()
           
 
Method Summary
 String format(Date value, Locale locale, Properties properties)
          Formats the value as a date.
 DateFormat getDateFormatter(Locale locale)
          Gets a dateformatter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatDate

public FormatDate()
Method Detail

format

public String format(Date value,
                     Locale locale,
                     Properties properties)
Formats the value as a date. In this version the format is always the short german format dd.mm.yyyy TODO use locale

Specified by:
format in interface FormatIF<Date>
Parameters:
value - Value to be formatted. This can be any type as long toString() delivers a date formattable value
locale - Locale to be used. If null then the default locale is used (Ignored in this version)
properties - Not used in this formatter.
Returns:
A Formatted date

getDateFormatter

public DateFormat getDateFormatter(Locale locale)
Gets a dateformatter. This method can be overwritten by other formatters to format the date in another way.

Parameters:
locale - Locale to be used
Returns:
a DateFormatter.


Copyright © 2012. All Rights Reserved.