KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > dom > generic > GenericLinkedHTMLDocument


1 package org.enhydra.xml.xmlc.dom.generic;
2
3 import org.enhydra.xml.xmlc.XMLObjectLink;
4 import org.w3c.dom.DOMException JavaDoc;
5 import org.w3c.dom.Node JavaDoc;
6 import org.w3c.dom.NodeList JavaDoc;
7 import org.w3c.dom.html.HTMLCollection;
8 import org.w3c.dom.html.HTMLDocument;
9 import org.w3c.dom.html.HTMLElement;
10
11 /**
12  * This is a generic wrapper around {@link HTMLDocument} that adds {@link
13  * XMLObjectLink} functionality.
14  */

15 public class GenericLinkedHTMLDocument extends GenericLinkedDocument
16                                        implements HTMLDocument {
17     /**
18      * Constructor.
19      * @param inner the document to be wrapped.
20      */

21     public GenericLinkedHTMLDocument(HTMLDocument inner) {
22     super(inner);
23     }
24
25     /** @see Node#cloneNode */
26     public Node JavaDoc cloneNode(boolean deep) {
27     // Make sure the cloned document is an object link as well,
28
// and points back to the same object...
29
GenericLinkedHTMLDocument clone =
30         new GenericLinkedHTMLDocument(
31                  (HTMLDocument)DELEGATE.cloneNode(deep));
32     clone.setXMLObject(getXMLObject());
33     return clone;
34     }
35
36     // Everything below here simply passes all calls through to the
37
// wrapped object...
38

39     public String JavaDoc getTitle() {
40         return ((HTMLDocument)DELEGATE).getTitle();
41     }
42     public void setTitle(String JavaDoc title) {
43         ((HTMLDocument)DELEGATE).setTitle(title);
44     }
45
46     public String JavaDoc getReferrer() {
47         return ((HTMLDocument)DELEGATE).getReferrer();
48     }
49
50     public String JavaDoc getDomain() {
51         return ((HTMLDocument)DELEGATE).getDomain();
52     }
53
54     public String JavaDoc getURL() {
55         return ((HTMLDocument)DELEGATE).getURL();
56     }
57
58     public HTMLElement getBody() {
59         return ((HTMLDocument)DELEGATE).getBody();
60     }
61     public void setBody(HTMLElement body) {
62     ((HTMLDocument)DELEGATE).setBody(body);
63     }
64
65     public HTMLCollection getImages() {
66         return ((HTMLDocument)DELEGATE).getImages();
67     }
68
69     public HTMLCollection getApplets() {
70         return ((HTMLDocument)DELEGATE).getApplets();
71     }
72
73     public HTMLCollection getLinks() {
74         return ((HTMLDocument)DELEGATE).getLinks();
75     }
76
77     public HTMLCollection getForms() {
78         return ((HTMLDocument)DELEGATE).getForms();
79     }
80
81     public HTMLCollection getAnchors() {
82         return ((HTMLDocument)DELEGATE).getAnchors();
83     }
84
85     public String JavaDoc getCookie() {
86         return ((HTMLDocument)DELEGATE).getCookie();
87     }
88     public void setCookie(String JavaDoc cookie) throws DOMException JavaDoc {
89         ((HTMLDocument)DELEGATE).setCookie(cookie);
90     }
91
92     public void open() {
93         ((HTMLDocument)DELEGATE).open();
94     }
95
96     public void close() {
97         ((HTMLDocument)DELEGATE).close();
98     }
99
100     public void write(String JavaDoc text) {
101         ((HTMLDocument)DELEGATE).write(text);
102     }
103
104     public void writeln(String JavaDoc text) {
105         ((HTMLDocument)DELEGATE).writeln(text);
106     }
107
108     public NodeList JavaDoc getElementsByName(String JavaDoc elementName) {
109         return ((HTMLDocument)DELEGATE).getElementsByName(elementName);
110     }
111
112 }
113
Popular Tags