01: package dinamica;
02:
03: import java.util.Locale;
04:
05: /**
06: * Interface that MUST be implemented
07: * by custom formatters. These plugins
08: * provide extended functionality for format masks
09: * 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: * Format value according to custom-made rules
30: * @param colName Column name of the recordset that contains the value to be formatted
31: * @param rs Recordset that contains the record with the value
32: * to be formatted; current position is the record in question
33: * @param locale Current locale if defined in the user session - may be null
34: * @param args String that contains the list of "parameters", meaning
35: * whatever text that was included after the classname surrounded by (...).
36: * Example: ${fld:myColName@class:com.Myformatter(AnyParameter1,AnyParameter2)}<br>
37: * It's the responsibility of the programmer to interpret this String and
38: * convert it to an array of Strings if necessary.
39: * @return String representation of the formatted value
40: * @throws Throwable
41: */
42: public String format(String colName, Recordset rs, Locale locale,
43: String args) throws Throwable;
44:
45: }
|