org.peaseplate.internal.transformer
Class FormatTransformers

java.lang.Object
  extended by org.peaseplate.internal.transformer.FormatTransformers

public class FormatTransformers
extends java.lang.Object


Constructor Summary
FormatTransformers()
           
 
Method Summary
 java.lang.String currency(RenderContext context, java.lang.Number value)
          Formats the value as currency using the NumberFormat and the locale from the context
 java.lang.String date(RenderContext context, java.util.Date value, java.lang.String pattern)
          Formats the date using the SimpleDateFormat and the locale fomr the context and the pattern
 java.lang.String fullDate(RenderContext context, java.util.Date value)
          Formats the date as full date using the DateFormat and the locale from the context
 java.lang.String fullDateTime(RenderContext context, java.util.Date value)
          Formats the date as full date/time using the DateFormat and the locale from the context
 java.lang.String fullTime(RenderContext context, java.util.Date value)
          Formats the date as full time using the DateFormat and the locale from the context
 java.lang.String integer(RenderContext context, java.lang.Number value)
          Formats the value as integer using the NumberFormat and the locale from the context
 java.lang.String longDate(RenderContext context, java.util.Date value)
          Formats the date as long date using the DateFormat and the locale from the context
 java.lang.String longDateTime(RenderContext context, java.util.Date value)
          Formats the date as long date/time using the DateFormat and the locale from the context
 java.lang.String longTime(RenderContext context, java.util.Date value)
          Formats the date as long time using the DateFormat and the locale from the context
 java.lang.String mediumDate(RenderContext context, java.util.Date value)
          Formats the date as medium date using the DateFormat and the locale from the context
 java.lang.String mediumDateTime(RenderContext context, java.util.Date value)
          Formats the date as medium date/time using the DateFormat and the locale from the context
 java.lang.String mediumTime(RenderContext context, java.util.Date value)
          Formats the date as medium time using the DateFormat and the locale from the context
 java.lang.String number(RenderContext context, java.lang.Number value)
          Formats the value using the DecimalFormat and the locale from the context
 java.lang.String number(RenderContext context, java.lang.Number value, java.lang.String pattern)
          Formats the value using the DecimalFormat and the locale from the context and the specified pattern
 java.lang.String percent(RenderContext context, java.lang.Number value)
          Formats the value as percentage using the NumberFormat and the locale from the context
 java.lang.String shortDate(RenderContext context, java.util.Date value)
          Formats the date as short date using the DateFormat and the locale from the context
 java.lang.String shortDateTime(RenderContext context, java.util.Date value)
          Formats the date as short date/time using the DateFormat and the locale from the context
 java.lang.String shortTime(RenderContext context, java.util.Date value)
          Formats the date as short time using the DateFormat and the locale from the context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatTransformers

public FormatTransformers()
Method Detail

number

public java.lang.String number(RenderContext context,
                               java.lang.Number value)
Formats the value using the DecimalFormat and the locale from the context

Parameters:
context - the context
value - the value
Returns:
the formatted value

number

public java.lang.String number(RenderContext context,
                               java.lang.Number value,
                               java.lang.String pattern)
Formats the value using the DecimalFormat and the locale from the context and the specified pattern

Parameters:
context - the context
value - the value
pattern - the pattern according to the DecimalFormat
Returns:
the formatted value

currency

public java.lang.String currency(RenderContext context,
                                 java.lang.Number value)
Formats the value as currency using the NumberFormat and the locale from the context

Parameters:
context - the context
value - the value
Returns:
the formatted value

integer

public java.lang.String integer(RenderContext context,
                                java.lang.Number value)
Formats the value as integer using the NumberFormat and the locale from the context

Parameters:
context - the context
value - the value
Returns:
the formatted value

percent

public java.lang.String percent(RenderContext context,
                                java.lang.Number value)
Formats the value as percentage using the NumberFormat and the locale from the context

Parameters:
context - the context
value - the value
Returns:
the formatted value

date

public java.lang.String date(RenderContext context,
                             java.util.Date value,
                             java.lang.String pattern)
Formats the date using the SimpleDateFormat and the locale fomr the context and the pattern

Parameters:
context - the context
value - the value
pattern - the pattern according to the SimpleDateFormat
Returns:
the formatted date

shortDate

public java.lang.String shortDate(RenderContext context,
                                  java.util.Date value)
Formats the date as short date using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

mediumDate

public java.lang.String mediumDate(RenderContext context,
                                   java.util.Date value)
Formats the date as medium date using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

longDate

public java.lang.String longDate(RenderContext context,
                                 java.util.Date value)
Formats the date as long date using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

fullDate

public java.lang.String fullDate(RenderContext context,
                                 java.util.Date value)
Formats the date as full date using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

shortDateTime

public java.lang.String shortDateTime(RenderContext context,
                                      java.util.Date value)
Formats the date as short date/time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

mediumDateTime

public java.lang.String mediumDateTime(RenderContext context,
                                       java.util.Date value)
Formats the date as medium date/time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

longDateTime

public java.lang.String longDateTime(RenderContext context,
                                     java.util.Date value)
Formats the date as long date/time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

fullDateTime

public java.lang.String fullDateTime(RenderContext context,
                                     java.util.Date value)
Formats the date as full date/time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

shortTime

public java.lang.String shortTime(RenderContext context,
                                  java.util.Date value)
Formats the date as short time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

mediumTime

public java.lang.String mediumTime(RenderContext context,
                                   java.util.Date value)
Formats the date as medium time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

longTime

public java.lang.String longTime(RenderContext context,
                                 java.util.Date value)
Formats the date as long time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date

fullTime

public java.lang.String fullTime(RenderContext context,
                                 java.util.Date value)
Formats the date as full time using the DateFormat and the locale from the context

Parameters:
context - the context
value - the date
Returns:
the formatted date


Copyright © 2008. All Rights Reserved.