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