org.springframework.web.servlet.view.xslt
Class FormatHelper

java.lang.Object
  extended by org.springframework.web.servlet.view.xslt.FormatHelper

Deprecated. as of Spring 1.2.9; to be removed

public abstract class FormatHelper
extends Object

Xalan extension functions to provide date and currency formatting beyond the capabilities of XSLT 1.0 or 1.1.

Note that all extension functions are static. These extension functions must be declared to use this class.

Based on an example by Taylor Cowan.

Author:
Rod Johnson
See Also:
AbstractXsltView

Nested Class Summary
static class FormatHelper.XsltFormattingException
          Deprecated. Exception thrown in case of formatting failure.
 
Constructor Summary
FormatHelper()
          Deprecated.  
 
Method Summary
static String currency(double amount, Locale locale)
          Deprecated. Format a currency amount in a given locale.
static String currency(double amount, String language, String country)
          Deprecated. Format a currency amount for a given language and country.
static Node dateTimeElement(long time)
          Deprecated. Creates a formatted-date node with system default Locale
static Node dateTimeElement(long time, Locale locale)
          Deprecated. Creates a formatted-date node with the given Locale
static Node dateTimeElement(long time, String language, String country)
          Deprecated. Creates a formatted-date node with the given ISO language and country strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatHelper

public FormatHelper()
Deprecated. 
Method Detail

dateTimeElement

public static Node dateTimeElement(long time,
                                   String language,
                                   String country)
Deprecated. 
Creates a formatted-date node with the given ISO language and country strings. If either the language or country parameters are null, the system default Locale will be used.

Parameters:
time - the time in ms since the epoch that should be used to obtain the formatted date
language - the two character language code required to construct a java.util.Locale
country - the two character country code required to construct a java.util.Locale
Returns:
a W3C Node containing child Elements with the formatted date-time fragments

dateTimeElement

public static Node dateTimeElement(long time)
Deprecated. 
Creates a formatted-date node with system default Locale

Parameters:
time - the time in ms since the epoch that should be used to obtain the formatted date
Returns:
a W3C Node containing child Elements with the formatted date-time fragments

dateTimeElement

public static Node dateTimeElement(long time,
                                   Locale locale)
Deprecated. 
Creates a formatted-date node with the given Locale

Parameters:
time - the time in ms since the epoch that should be used to obtain the formatted date
locale - the java.util.Locale to determine the date formatting
Returns:
a W3C Node containing child Elements with the formatted date-time fragments

currency

public static String currency(double amount,
                              Locale locale)
Deprecated. 
Format a currency amount in a given locale.

Parameters:
amount - the currency value to format
locale - the java.util.Locale to use to format the amount
Returns:
a formatted String representing the amount

currency

public static String currency(double amount,
                              String language,
                              String country)
Deprecated. 
Format a currency amount for a given language and country.

Parameters:
amount - the currency value to format
language - the two character language code required to construct a java.util.Locale
country - the two character country code required to construct a java.util.Locale
Returns:
a formatted String representing the amount


Copyright (c) 2002-2007 The Spring Framework Project.