org.displaytag.decorator
Class MessageFormatColumnDecorator

java.lang.Object
  extended by org.displaytag.decorator.MessageFormatColumnDecorator
All Implemented Interfaces:
DisplaytagColumnDecorator

public class MessageFormatColumnDecorator
extends java.lang.Object
implements DisplaytagColumnDecorator

A decorator that simply formats input Objects using a java.text.messageFormat. By design, this implementations handle MessageFormat errors by returning the unformatted value and logging the exception.

Version:
$Id$
Author:
Fabrizio Giustina

Constructor Summary
MessageFormatColumnDecorator(java.lang.String pattern, java.util.Locale locale)
          Instantiates a new MessageFormatColumnDecorator with a given pattern and locale.
 
Method Summary
 java.lang.Object decorate(java.lang.Object columnValue, javax.servlet.jsp.PageContext pageContext, MediaTypeEnum media)
          Called after the object has been retrieved from the bean contained in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFormatColumnDecorator

public MessageFormatColumnDecorator(java.lang.String pattern,
                                    java.util.Locale locale)
Instantiates a new MessageFormatColumnDecorator with a given pattern and locale.

Parameters:
pattern - see java.text.messageFormat
locale - current locale
See Also:
java.text.messageFormat
Method Detail

decorate

public java.lang.Object decorate(java.lang.Object columnValue,
                                 javax.servlet.jsp.PageContext pageContext,
                                 MediaTypeEnum media)
Description copied from interface: DisplaytagColumnDecorator
Called after the object has been retrieved from the bean contained in the list. The decorate method is responsible for transforming the object into a string to render in the page.

Specified by:
decorate in interface DisplaytagColumnDecorator
Parameters:
columnValue - Object to decorate
pageContext - jsp page context
media - current media (html, pdf, excel...)
Returns:
Object decorated object
See Also:
DisplaytagColumnDecorator.decorate(Object, PageContext, MediaTypeEnum)


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.