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