01: /* DefaultIDOMFactory.java
02:
03: {{IS_NOTE
04:
05: Purpose:
06: Description:
07: History:
08: 2001/10/25 12:00:50, 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: * The default iDOM factory.
24: *
25: * @author tomyeh
26: */
27: public class DefaultIDOMFactory implements IDOMFactory {
28: /** Constructor.
29: */
30: public DefaultIDOMFactory() {
31: }
32:
33: //-- IDOMFactory --//
34: public Attribute newAttribute(String lname, String value) {
35: return new Attribute(lname, value);
36: }
37:
38: public Attribute newAttribute(Namespace ns, String lname,
39: String value) {
40: return new Attribute(ns, lname, value);
41: }
42:
43: public CData newCData(String text) {
44: return new CData(text);
45: }
46:
47: public Comment newComment(String text) {
48: return new Comment(text);
49: }
50:
51: public DocType newDocType(String elementName, String publicId,
52: String systemId) {
53: return new DocType(elementName, publicId, systemId);
54: }
55:
56: public Document newDocument(Element rootElement, DocType docType) {
57: return new Document(rootElement, docType);
58: }
59:
60: public Element newElement(Namespace ns, String lname) {
61: return new Element(ns, lname);
62: }
63:
64: public Element newElement(String lname) {
65: return new Element(lname);
66: }
67:
68: public ProcessingInstruction newProcessingInstruction(
69: String target, String data) {
70: return new ProcessingInstruction(target, data);
71: }
72:
73: public EntityReference newEntityRef(String name) {
74: return new EntityReference(name);
75: }
76:
77: public Text newText(String text) {
78: return new Text(text);
79: }
80: }
|