KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > convert > NodeConverter


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.convert;
14
15 import java.lang.reflect.InvocationTargetException JavaDoc;
16 import java.util.Map JavaDoc;
17
18 import org.w3c.dom.Element JavaDoc;
19
20 import com.tonbeller.wcf.format.FormatException;
21 import com.tonbeller.wcf.format.Formatter;
22
23 /**
24  *
25  * @author av
26  */

27 public interface NodeConverter {
28
29   /**
30    * converts http parameters in requestSource and updates the domTarget and beanTarget.
31    * the domTarget also contains metadata, e.g. the type and formatString attributes.
32    * @param fmt Formatter to be used to parse and format user input
33    * @param requestSource a map containing http parameters. key = String, value = String[]
34    * @param domTarget a DOM tree containing UI elements like TextField etc including the following
35    * attributes:
36    * <ul>
37    * <li><code>type</code> the data type, i.e. the id to find the formatter
38    * <li><code>value</code> the formatted value will be written to this attribute
39    * <li><code>formatString</code> optional, overwrites the default formatString of the FormatHandler
40    * <li><code>modelReference</code> optional, if present the attribute name of the bean property.
41    * a jakarta-commons/bean-utils path is supported
42    * <li><code>id</code> unique id. Used to identify DOM elements from HTTP Parameters
43    * </ul>
44    * @param
45    */

46   void convert(Formatter fmt, Map JavaDoc requestSource, Map JavaDoc fileSource, Element JavaDoc domTarget, Object JavaDoc beanTarget)
47     throws ConvertException, FormatException, IllegalAccessException JavaDoc, NoSuchMethodException JavaDoc, InvocationTargetException JavaDoc;
48
49   /**
50    * updates the domTarget according to the current property values of beanSource
51    */

52   void convert(Formatter fmt, Object JavaDoc beanSource, Element JavaDoc domTarget)
53     throws ConvertException, IllegalAccessException JavaDoc, NoSuchMethodException JavaDoc, InvocationTargetException JavaDoc;
54
55   /**
56    * return the element name that this handler will handle
57    */

58   String JavaDoc getElementName();
59   void setElementName(String JavaDoc elemName);
60
61
62 }
63
Popular Tags