org.apache.turbine.services.pull.util
Class DateFormatter

java.lang.Object
  extended byorg.apache.turbine.services.pull.util.DateFormatter
All Implemented Interfaces:
ApplicationTool

public class DateFormatter
extends java.lang.Object
implements ApplicationTool

This pull tool is used to format date objects into strings.

As this is designed to be used as a gloal scope pull tool it needs to be threadsafe.

This is an application pull tool for the template system. You should not use it in a normal application.

Version:
$Id: DateFormatter.java 264148 2005-08-29 14:21:04Z henning $
Author:
Quinton McCombs, Scott Eade

Constructor Summary
DateFormatter()
           
 
Method Summary
 java.lang.String format(java.util.Date theDate)
          Formats the given date as a String using the default date format.
 java.lang.String format(java.util.Date theDate, java.lang.String dateFormatString)
          Formats the given date as a String.
 void init(java.lang.Object data)
          Initialize the application tool.
 void refresh()
          Refresh the application tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFormatter

public DateFormatter()
Method Detail

init

public void init(java.lang.Object data)
Initialize the application tool. The data parameter holds a different type depending on how the tool is being instantiated:

refresh

public void refresh()
Refresh the application tool. This is necessary for development work where you probably want the tool to refresh itself if it is using configuration information that is typically cached after initialization.

Specified by:
refresh in interface ApplicationTool

format

public java.lang.String format(java.util.Date theDate)
Formats the given date as a String using the default date format. The default date format is MM/dd/yyyy

Parameters:
theDate - date to format
Returns:
String value of the date

format

public java.lang.String format(java.util.Date theDate,
                               java.lang.String dateFormatString)
Formats the given date as a String.

Parameters:
theDate - date to format
dateFormatString - format string to use. See java.text.SimpleDateFormat for details.
Returns:
String value of the date


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.