1
2
3
4
5
6
7
8
9
10 package org.dom4j.dom;
11
12 import org.dom4j.Element;
13 import org.dom4j.tree.DefaultNamespace;
14 import org.w3c.dom.DOMException;
15 import org.w3c.dom.Document;
16 import org.w3c.dom.NamedNodeMap;
17 import org.w3c.dom.NodeList;
18
19 /*** <p><code>DOMNamespace</code> implements a Namespace that is compatable
20 * with the DOM API.</p>
21 *
22 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
23 * @version $Revision: 1.7 $
24 */
25 public class DOMNamespace extends DefaultNamespace implements org.w3c.dom.Node {
26
27 public DOMNamespace(String prefix, String uri) {
28 super( prefix, uri );
29 }
30
31 public DOMNamespace(Element parent, String prefix, String uri) {
32 super( parent, prefix, uri );
33 }
34
35
36
37
38
39 public boolean supports(String feature, String version) {
40 return DOMNodeHelper.supports(this, feature, version);
41 }
42
43 public String getNamespaceURI() {
44 return DOMNodeHelper.getNamespaceURI(this);
45 }
46
47 public String getPrefix() {
48 return DOMNodeHelper.getPrefix(this);
49 }
50
51 public void setPrefix(String prefix) throws DOMException {
52 DOMNodeHelper.setPrefix(this, prefix);
53 }
54
55 public String getLocalName() {
56 return DOMNodeHelper.getLocalName(this);
57 }
58
59 public String getNodeName() {
60 return getName();
61 }
62
63
64
65
66
67
68
69 public String getNodeValue() throws DOMException {
70 return DOMNodeHelper.getNodeValue(this);
71 }
72
73 public void setNodeValue(String nodeValue) throws DOMException {
74 DOMNodeHelper.setNodeValue(this, nodeValue);
75 }
76
77
78 public org.w3c.dom.Node getParentNode() {
79 return DOMNodeHelper.getParentNode(this);
80 }
81
82 public NodeList getChildNodes() {
83 return DOMNodeHelper.getChildNodes(this);
84 }
85
86 public org.w3c.dom.Node getFirstChild() {
87 return DOMNodeHelper.getFirstChild(this);
88 }
89
90 public org.w3c.dom.Node getLastChild() {
91 return DOMNodeHelper.getLastChild(this);
92 }
93
94 public org.w3c.dom.Node getPreviousSibling() {
95 return DOMNodeHelper.getPreviousSibling(this);
96 }
97
98 public org.w3c.dom.Node getNextSibling() {
99 return DOMNodeHelper.getNextSibling(this);
100 }
101
102 public NamedNodeMap getAttributes() {
103 return DOMNodeHelper.getAttributes(this);
104 }
105
106 public Document getOwnerDocument() {
107 return DOMNodeHelper.getOwnerDocument(this);
108 }
109
110 public org.w3c.dom.Node insertBefore(
111 org.w3c.dom.Node newChild,
112 org.w3c.dom.Node refChild
113 ) throws DOMException {
114 return DOMNodeHelper.insertBefore(this, newChild, refChild);
115 }
116
117 public org.w3c.dom.Node replaceChild(
118 org.w3c.dom.Node newChild,
119 org.w3c.dom.Node oldChild
120 ) throws DOMException {
121 return DOMNodeHelper.replaceChild(this, newChild, oldChild);
122 }
123
124 public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws DOMException {
125 return DOMNodeHelper.removeChild(this, oldChild);
126 }
127
128 public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws DOMException {
129 return DOMNodeHelper.appendChild(this, newChild);
130 }
131
132 public boolean hasChildNodes() {
133 return DOMNodeHelper.hasChildNodes(this);
134 }
135
136 public org.w3c.dom.Node cloneNode(boolean deep) {
137 return DOMNodeHelper.cloneNode(this, deep);
138 }
139
140 public void normalize() {
141 DOMNodeHelper.normalize(this);
142 }
143
144 public boolean isSupported(String feature, String version) {
145 return DOMNodeHelper.isSupported(this, feature, version);
146 }
147
148 public boolean hasAttributes() {
149 return DOMNodeHelper.hasAttributes(this);
150 }
151 }
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199