01: package uk.org.ponder.saxalizer;
02:
03: import java.util.Enumeration;
04:
05: /** Classes implementing the GenericSAX interface do not have
06: * specifically named methods for all of the subobjects that they
07: * want serialized as XML. Instead, objects of arbitary types are
08: * piled into them via the <code>addChild</code> method, and read
09: * out by the <code>size</code> and <code>elementAt</code>
10: * methods. This makes GenericSAX objects very much more like
11: * DOM nodes than plain SAXalizable objects.
12: * <p>
13: * Note - the "Generic" infrastructure has not been recently used and is
14: * not supported by the current SAXalizer infrastructure.
15: * */
16:
17: public interface GenericSAX extends SAXalizableExtraAttrs,
18: DeSAXalizable {
19: /** Gets the (text) data, if any, associated with this XML node. Note that text is
20: * currently not supported for nodes which in addition have children.
21: * @return The required text data.
22: */
23: public String getData();
24:
25: /** Sets the text data associated with this XML node.
26: * @param s The required text data.
27: */
28: public void setData(String s);
29:
30: /** Gets the XML tag that will be supplied to this object in its serialized form.
31: * @return The required XML tag.
32: */
33: public String getTag();
34:
35: /** Sets the XML tag that will be applied to this object in its serialized form.
36: * @param s The required XML tag.
37: */
38: public void setTag(String s);
39:
40: /** Adds the specified node to this node as a child.
41: * @param child The required child node.
42: */
43: public void addChild(GenericSAX child);
44:
45: /** Finds the first (if any) child node having the specified tag.
46: * @param The required tag to be found.
47: * @return The first child node bearing the supplied tag, if any, or
48: * <code>null</code> if no such child exists. */
49: public GenericSAXImpl findChild(String tagname);
50:
51: /** Returns the number of child nodes for this node.
52: * @return The required number of child nodes.
53: */
54: public int size();
55:
56: /** Returns an enumeration of all child nodes for this node.
57: * @return The required enumeration of all child nodes.
58: */
59: public Enumeration getChildEnum();
60: }
|