View Javadoc

1   /***
2    * Licensed under the Artistic License; you may not use this file
3    * except in compliance with the License.
4    * You may obtain a copy of the License at
5    *
6    *      http://displaytag.sourceforge.net/license.html
7    *
8    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
9    * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11   */
12  package org.displaytag.decorator;
13  
14  import org.displaytag.exception.DecoratorException;
15  
16  
17  /***
18   * <p>
19   * Interface for simple column decorators.
20   * </p>
21   * <p>
22   * A column decorator is called after the object has been retrieved and it can "transform" the object before the
23   * rendering. A column decorator is simply an object formatter, and it is only aware of the value to format.
24   * </p>
25   * @author epesh
26   * @author Fabrizio Giustina
27   * @version $Revision: 1.9 $ ($Author: fgiust $)
28   */
29  public interface ColumnDecorator
30  {
31  
32      /***
33       * Called after the object has been retrieved from the bean contained in the list. The decorate method is
34       * responsible for transforming the object into a string to render in the page.
35       * @param columnValue Object to decorate
36       * @return String decorated object
37       * @throws DecoratorException wrapper exception for any exception thrown during decoration
38       */
39      String decorate(Object columnValue) throws DecoratorException;
40  
41  }