01: /* IDOMFactory.java
02:
03: {{IS_NOTE
04:
05: Purpose:
06: Description:
07: History:
08: 2001/10/25 11:32:45, Create, Tom M. Yeh.
09: }}IS_NOTE
10:
11: Copyright (C) 2001 Potix Corporation. All Rights Reserved.
12:
13: {{IS_RIGHT
14: This program is distributed under GPL Version 2.0 in the hope that
15: it will be useful, but WITHOUT ANY WARRANTY.
16: }}IS_RIGHT
17: */
18: package org.zkoss.idom.input;
19:
20: import org.zkoss.idom.*;
21:
22: /**
23: * A dom factory. It is the interface used by SaxBuild to create
24: * corresponding vertices. By implementing this interface or
25: * overriding DefaultDomFactory, caller could create a set of
26: * vertices other than the default ones.
27: *
28: * @author tomyeh
29: * @see SAXBuilder
30: */
31: public interface IDOMFactory {
32: /**
33: * Creates an Attribute without namespace.
34: */
35: public Attribute newAttribute(String lname, String value);
36:
37: /**
38: * Creates an Attribute with namespace.
39: */
40: public Attribute newAttribute(Namespace ns, String lname,
41: String value);
42:
43: /**
44: * Creates a CData.
45: */
46: public CData newCData(String text);
47:
48: /**
49: * Creates a Comment.
50: */
51: public Comment newComment(String text);
52:
53: /**
54: * Creates a DocType.
55: *
56: * @param elementName the root element's name
57: * @param publicId the public Id; null for empty
58: * @param systemId the system Id; null for empty
59: */
60: public DocType newDocType(String elementName, String publicId,
61: String systemId);
62:
63: /**
64: * Creates a Document.
65: *
66: * @param docType the document type; null for not available
67: */
68: public Document newDocument(Element rootElement, DocType docType);
69:
70: /**
71: * Creates an Element with a namespace.
72: */
73: public Element newElement(Namespace ns, String lname);
74:
75: /**
76: * Creates an Element without namespace.
77: */
78: public Element newElement(String lname);
79:
80: /**
81: * Creates a processing instruction.
82: *
83: * @param data the raw data; null for empty
84: */
85: public ProcessingInstruction newProcessingInstruction(
86: String target, String data);
87:
88: /**
89: * Creates a Entityref.
90: *
91: * @param name the entity reference's name
92: */
93: public EntityReference newEntityRef(String name);
94:
95: /**
96: * Creates a Text.
97: */
98: public Text newText(String text);
99: }
|