1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| package org.dom4j.dom; |
11 |
| |
12 |
| import java.util.Map; |
13 |
| |
14 |
| import org.dom4j.Element; |
15 |
| import org.dom4j.tree.DefaultProcessingInstruction; |
16 |
| import org.w3c.dom.DOMException; |
17 |
| import org.w3c.dom.Document; |
18 |
| import org.w3c.dom.NamedNodeMap; |
19 |
| import org.w3c.dom.NodeList; |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class DOMProcessingInstruction extends DefaultProcessingInstruction implements org.w3c.dom.ProcessingInstruction { |
28 |
| |
29 |
0
| public DOMProcessingInstruction(String target, Map values) {
|
30 |
0
| super(target, values);
|
31 |
| } |
32 |
| |
33 |
18
| public DOMProcessingInstruction(String target, String values) {
|
34 |
18
| super(target, values);
|
35 |
| } |
36 |
| |
37 |
0
| public DOMProcessingInstruction(Element parent, String target, String values) {
|
38 |
0
| super(parent, target, values);
|
39 |
| } |
40 |
| |
41 |
| |
42 |
| |
43 |
| |
44 |
0
| public boolean supports(String feature, String version) {
|
45 |
0
| return DOMNodeHelper.supports(this, feature, version);
|
46 |
| } |
47 |
| |
48 |
0
| public String getNamespaceURI() {
|
49 |
0
| return DOMNodeHelper.getNamespaceURI(this);
|
50 |
| } |
51 |
| |
52 |
0
| public String getPrefix() {
|
53 |
0
| return DOMNodeHelper.getPrefix(this);
|
54 |
| } |
55 |
| |
56 |
0
| public void setPrefix(String prefix) throws DOMException {
|
57 |
0
| DOMNodeHelper.setPrefix(this, prefix);
|
58 |
| } |
59 |
| |
60 |
0
| public String getLocalName() {
|
61 |
0
| return DOMNodeHelper.getLocalName(this);
|
62 |
| } |
63 |
| |
64 |
0
| public String getNodeName() {
|
65 |
0
| return getName();
|
66 |
| } |
67 |
| |
68 |
| |
69 |
| |
70 |
| |
71 |
| |
72 |
| |
73 |
| |
74 |
0
| public String getNodeValue() throws DOMException {
|
75 |
0
| return DOMNodeHelper.getNodeValue(this);
|
76 |
| } |
77 |
| |
78 |
0
| public void setNodeValue(String nodeValue) throws DOMException {
|
79 |
0
| DOMNodeHelper.setNodeValue(this, nodeValue);
|
80 |
| } |
81 |
| |
82 |
| |
83 |
0
| public org.w3c.dom.Node getParentNode() {
|
84 |
0
| return DOMNodeHelper.getParentNode(this);
|
85 |
| } |
86 |
| |
87 |
0
| public NodeList getChildNodes() {
|
88 |
0
| return DOMNodeHelper.getChildNodes(this);
|
89 |
| } |
90 |
| |
91 |
0
| public org.w3c.dom.Node getFirstChild() {
|
92 |
0
| return DOMNodeHelper.getFirstChild(this);
|
93 |
| } |
94 |
| |
95 |
0
| public org.w3c.dom.Node getLastChild() {
|
96 |
0
| return DOMNodeHelper.getLastChild(this);
|
97 |
| } |
98 |
| |
99 |
0
| public org.w3c.dom.Node getPreviousSibling() {
|
100 |
0
| return DOMNodeHelper.getPreviousSibling(this);
|
101 |
| } |
102 |
| |
103 |
0
| public org.w3c.dom.Node getNextSibling() {
|
104 |
0
| return DOMNodeHelper.getNextSibling(this);
|
105 |
| } |
106 |
| |
107 |
0
| public NamedNodeMap getAttributes() {
|
108 |
0
| return null;
|
109 |
| } |
110 |
| |
111 |
0
| public Document getOwnerDocument() {
|
112 |
0
| return DOMNodeHelper.getOwnerDocument(this);
|
113 |
| } |
114 |
| |
115 |
0
| public org.w3c.dom.Node insertBefore(
|
116 |
| org.w3c.dom.Node newChild, |
117 |
| org.w3c.dom.Node refChild |
118 |
| ) throws DOMException { |
119 |
0
| checkNewChildNode(newChild);
|
120 |
0
| return DOMNodeHelper.insertBefore(this, newChild, refChild);
|
121 |
| } |
122 |
| |
123 |
0
| public org.w3c.dom.Node replaceChild(
|
124 |
| org.w3c.dom.Node newChild, |
125 |
| org.w3c.dom.Node oldChild |
126 |
| ) throws DOMException { |
127 |
0
| checkNewChildNode(newChild);
|
128 |
0
| return DOMNodeHelper.replaceChild(this, newChild, oldChild);
|
129 |
| } |
130 |
| |
131 |
0
| public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws DOMException {
|
132 |
0
| return DOMNodeHelper.removeChild(this, oldChild);
|
133 |
| } |
134 |
| |
135 |
0
| public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws DOMException {
|
136 |
0
| checkNewChildNode(newChild);
|
137 |
0
| return DOMNodeHelper.appendChild(this, newChild);
|
138 |
| } |
139 |
| |
140 |
0
| private void checkNewChildNode(org.w3c.dom.Node newChild) throws DOMException {
|
141 |
0
| throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
|
142 |
| "ProcessingInstruction nodes cannot have children"); |
143 |
| } |
144 |
| |
145 |
| |
146 |
0
| public boolean hasChildNodes() {
|
147 |
0
| return DOMNodeHelper.hasChildNodes(this);
|
148 |
| } |
149 |
| |
150 |
0
| public org.w3c.dom.Node cloneNode(boolean deep) {
|
151 |
0
| return DOMNodeHelper.cloneNode(this, deep);
|
152 |
| } |
153 |
| |
154 |
0
| public void normalize() {
|
155 |
0
| DOMNodeHelper.normalize(this);
|
156 |
| } |
157 |
| |
158 |
0
| public boolean isSupported(String feature, String version) {
|
159 |
0
| return DOMNodeHelper.isSupported(this, feature, version);
|
160 |
| } |
161 |
| |
162 |
0
| public boolean hasAttributes() {
|
163 |
0
| return DOMNodeHelper.hasAttributes(this);
|
164 |
| } |
165 |
| |
166 |
| |
167 |
| |
168 |
| |
169 |
| |
170 |
| |
171 |
0
| public String getData() {
|
172 |
0
| return getText();
|
173 |
| } |
174 |
| |
175 |
0
| public void setData(String data) throws DOMException {
|
176 |
0
| if ( isReadOnly() ) {
|
177 |
0
| throw new DOMException(
|
178 |
| DOMException.NO_MODIFICATION_ALLOWED_ERR, |
179 |
| "This ProcessingInstruction is read only" |
180 |
| ); |
181 |
| } |
182 |
| else { |
183 |
0
| setText(data);
|
184 |
| } |
185 |
| } |
186 |
| |
187 |
| |
188 |
| |
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 |
| |
228 |
| |
229 |
| |
230 |
| |
231 |
| |
232 |
| |
233 |
| |
234 |
| |
235 |
| |
236 |
| |
237 |
| |