Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      org.apache.turbine.services.pull.util.DateFormatter

All Implemented Interfaces:
  ApplicationTool

    public class DateFormatter

extends Object
implements ApplicationTool

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

Version:
  $Id: DateFormatter.java 1078552 2011-03-06 19:58:46Z tv $
Author:
  Quinton McCombs, Scott Eade

Constructor Summary
`DateFormatter()`

Method Summary
`String` | `format(Date theDate)` Formats the given date as a String using the default date format.
`String` | `format(Date theDate, String dateFormatString)` Formats the given date as a String.
`void` | `init(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(Object data)

  Initialize the application tool. The data parameter holds a different type depending on how the tool is being instantiated:
  - For global tools data will be null
  - For request tools data will be of type RunData
  - For session and persistent tools data will be of type User

  Specified by:
    `init` in interface `ApplicationTool`
  Parameters:
    `data` - initialization data

### 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 String format(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 String format(Date theDate,
                         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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.