KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dinamica > IFormatPlugin


1 package dinamica;
2
3 import java.util.Locale JavaDoc;
4
5 /**
6  * Interface that MUST be implemented
7  * by custom formatters. These plugins
8  * provide extended functionality for format masks
9  * that start with "class:". Example:
10  * <br><br>
11  * ${fld:MyColumn@class:com.formatters.MyFormatter}
12  * <br><br>
13  * The framework will load this class and then
14  * invoke the only method defined by this Interface.
15  * <br>
16  * The marker can also include "parameters" passed to the
17  * formatter class:<br>
18  * ${fld:myColName@class:com.Myformatter(AnyParameter1,AnyParameter2)}<br>
19  * <br><br>
20  * Creation date: 23/05/2005
21  * (c) 2005 Martin Cordova<br>
22  * This code is released under the LGPL license<br>
23  * Dinamica Framework - http://www.martincordova.com<br>
24  * @author Martin Cordova (dinamica@martincordova.com)
25  */

26 public interface IFormatPlugin
27 {
28
29     /**
30      * Format value according to custom-made rules
31      * @param colName Column name of the recordset that contains the value to be formatted
32      * @param rs Recordset that contains the record with the value
33      * to be formatted; current position is the record in question
34      * @param locale Current locale if defined in the user session - may be null
35      * @param args String that contains the list of "parameters", meaning
36      * whatever text that was included after the classname surrounded by (...).
37      * Example: ${fld:myColName@class:com.Myformatter(AnyParameter1,AnyParameter2)}<br>
38      * It's the responsibility of the programmer to interpret this String and
39      * convert it to an array of Strings if necessary.
40      * @return String representation of the formatted value
41      * @throws Throwable
42      */

43     public String JavaDoc format(String JavaDoc colName, Recordset rs, Locale JavaDoc locale, String JavaDoc args) throws Throwable JavaDoc;
44     
45 }
46
Popular Tags