1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| package org.dom4j.dom; |
9 |
| |
10 |
| import org.dom4j.Element; |
11 |
| import org.dom4j.tree.DefaultComment; |
12 |
| |
13 |
| import org.w3c.dom.DOMException; |
14 |
| import org.w3c.dom.Document; |
15 |
| import org.w3c.dom.NamedNodeMap; |
16 |
| import org.w3c.dom.NodeList; |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| public class DOMComment extends DefaultComment implements org.w3c.dom.Comment { |
27 |
12
| public DOMComment(String text) {
|
28 |
12
| super(text);
|
29 |
| } |
30 |
| |
31 |
0
| public DOMComment(Element parent, String text) {
|
32 |
0
| super(parent, text);
|
33 |
| } |
34 |
| |
35 |
| |
36 |
| |
37 |
0
| public boolean supports(String feature, String version) {
|
38 |
0
| return DOMNodeHelper.supports(this, feature, version);
|
39 |
| } |
40 |
| |
41 |
0
| public String getNamespaceURI() {
|
42 |
0
| return DOMNodeHelper.getNamespaceURI(this);
|
43 |
| } |
44 |
| |
45 |
0
| public String getPrefix() {
|
46 |
0
| return DOMNodeHelper.getPrefix(this);
|
47 |
| } |
48 |
| |
49 |
0
| public void setPrefix(String prefix) throws DOMException {
|
50 |
0
| DOMNodeHelper.setPrefix(this, prefix);
|
51 |
| } |
52 |
| |
53 |
0
| public String getLocalName() {
|
54 |
0
| return DOMNodeHelper.getLocalName(this);
|
55 |
| } |
56 |
| |
57 |
0
| public String getNodeName() {
|
58 |
0
| return "#comment";
|
59 |
| } |
60 |
| |
61 |
| |
62 |
| |
63 |
| |
64 |
0
| public String getNodeValue() throws DOMException {
|
65 |
0
| return DOMNodeHelper.getNodeValue(this);
|
66 |
| } |
67 |
| |
68 |
0
| public void setNodeValue(String nodeValue) throws DOMException {
|
69 |
0
| DOMNodeHelper.setNodeValue(this, nodeValue);
|
70 |
| } |
71 |
| |
72 |
0
| public org.w3c.dom.Node getParentNode() {
|
73 |
0
| return DOMNodeHelper.getParentNode(this);
|
74 |
| } |
75 |
| |
76 |
0
| public NodeList getChildNodes() {
|
77 |
0
| return DOMNodeHelper.getChildNodes(this);
|
78 |
| } |
79 |
| |
80 |
0
| public org.w3c.dom.Node getFirstChild() {
|
81 |
0
| return DOMNodeHelper.getFirstChild(this);
|
82 |
| } |
83 |
| |
84 |
0
| public org.w3c.dom.Node getLastChild() {
|
85 |
0
| return DOMNodeHelper.getLastChild(this);
|
86 |
| } |
87 |
| |
88 |
0
| public org.w3c.dom.Node getPreviousSibling() {
|
89 |
0
| return DOMNodeHelper.getPreviousSibling(this);
|
90 |
| } |
91 |
| |
92 |
0
| public org.w3c.dom.Node getNextSibling() {
|
93 |
0
| return DOMNodeHelper.getNextSibling(this);
|
94 |
| } |
95 |
| |
96 |
0
| public NamedNodeMap getAttributes() {
|
97 |
0
| return null;
|
98 |
| } |
99 |
| |
100 |
0
| public Document getOwnerDocument() {
|
101 |
0
| return DOMNodeHelper.getOwnerDocument(this);
|
102 |
| } |
103 |
| |
104 |
0
| public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
|
105 |
| org.w3c.dom.Node refChild) throws DOMException { |
106 |
0
| checkNewChildNode(newChild);
|
107 |
| |
108 |
0
| return DOMNodeHelper.insertBefore(this, newChild, refChild);
|
109 |
| } |
110 |
| |
111 |
0
| public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
|
112 |
| org.w3c.dom.Node oldChild) throws DOMException { |
113 |
0
| checkNewChildNode(newChild);
|
114 |
| |
115 |
0
| return DOMNodeHelper.replaceChild(this, newChild, oldChild);
|
116 |
| } |
117 |
| |
118 |
0
| public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
|
119 |
| throws DOMException { |
120 |
0
| return DOMNodeHelper.removeChild(this, oldChild);
|
121 |
| } |
122 |
| |
123 |
0
| public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
|
124 |
| throws DOMException { |
125 |
0
| checkNewChildNode(newChild);
|
126 |
| |
127 |
0
| return DOMNodeHelper.appendChild(this, newChild);
|
128 |
| } |
129 |
| |
130 |
0
| private void checkNewChildNode(org.w3c.dom.Node newChild)
|
131 |
| throws DOMException { |
132 |
0
| throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
|
133 |
| "Comment nodes cannot have children"); |
134 |
| } |
135 |
| |
136 |
0
| public boolean hasChildNodes() {
|
137 |
0
| return DOMNodeHelper.hasChildNodes(this);
|
138 |
| } |
139 |
| |
140 |
0
| public org.w3c.dom.Node cloneNode(boolean deep) {
|
141 |
0
| return DOMNodeHelper.cloneNode(this, deep);
|
142 |
| } |
143 |
| |
144 |
0
| public void normalize() {
|
145 |
0
| DOMNodeHelper.normalize(this);
|
146 |
| } |
147 |
| |
148 |
0
| public boolean isSupported(String feature, String version) {
|
149 |
0
| return DOMNodeHelper.isSupported(this, feature, version);
|
150 |
| } |
151 |
| |
152 |
0
| public boolean hasAttributes() {
|
153 |
0
| return DOMNodeHelper.hasAttributes(this);
|
154 |
| } |
155 |
| |
156 |
| |
157 |
| |
158 |
0
| public String getData() throws DOMException {
|
159 |
0
| return DOMNodeHelper.getData(this);
|
160 |
| } |
161 |
| |
162 |
0
| public void setData(String data) throws DOMException {
|
163 |
0
| DOMNodeHelper.setData(this, data);
|
164 |
| } |
165 |
| |
166 |
0
| public int getLength() {
|
167 |
0
| return DOMNodeHelper.getLength(this);
|
168 |
| } |
169 |
| |
170 |
0
| public String substringData(int offset, int count) throws DOMException {
|
171 |
0
| return DOMNodeHelper.substringData(this, offset, count);
|
172 |
| } |
173 |
| |
174 |
0
| public void appendData(String arg) throws DOMException {
|
175 |
0
| DOMNodeHelper.appendData(this, arg);
|
176 |
| } |
177 |
| |
178 |
0
| public void insertData(int offset, String arg) throws DOMException {
|
179 |
0
| DOMNodeHelper.insertData(this, offset, arg);
|
180 |
| } |
181 |
| |
182 |
0
| public void deleteData(int offset, int count) throws DOMException {
|
183 |
0
| DOMNodeHelper.deleteData(this, offset, count);
|
184 |
| } |
185 |
| |
186 |
0
| public void replaceData(int offset, int count, String arg)
|
187 |
| throws DOMException { |
188 |
0
| DOMNodeHelper.replaceData(this, offset, count, arg);
|
189 |
| } |
190 |
| } |
191 |
| |
192 |
| |
193 |
| |
194 |
| |
195 |
| |
196 |
| |
197 |
| |
198 |
| |
199 |
| |
200 |
| |
201 |
| |
202 |
| |
203 |
| |
204 |
| |
205 |
| |
206 |
| |
207 |
| |
208 |
| |
209 |
| |
210 |
| |
211 |
| |
212 |
| |
213 |
| |
214 |
| |
215 |
| |
216 |
| |
217 |
| |
218 |
| |
219 |
| |
220 |
| |
221 |
| |
222 |
| |
223 |
| |
224 |
| |
225 |
| |
226 |
| |
227 |
| |