Clover coverage report - dom4j - 1.6.1 Coverage timestamp: ma mei 16 2005 14:23:01 GMT+01:00 FRAMES NO FRAMES |
file stats: | LOC: | 217 |  | Methods: | 34
| NCLOC: | 118 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
DOMDocumentType.java | - | 0% | 0% | 0% |

1 |  | /*
2 |  | * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
3 |  | *
4 |  | * This software is open source.
5 |  | * See the bottom of this file for the licence.
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 |  | * <p>
19 |  | * <code>DOMDocumentType</code> implements a DocumentType node which supports
20 |  | * the W3C DOM API.
21 |  | * </p>
22 |  | *
23 |  | * @author <a href="mailto:james.strachan@metastuff.com">James Strachan </a>
24 |  | * @version $Revision: 1.11 $
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 |  | // org.w3c.dom.Node interface
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 |  | // already part of API
66 |  | //
67 |  | // public short getNodeType();
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 |  | // org.w3c.dom.DocumentType interface
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 |  | * Redistribution and use of this software and associated documentation
184 |  | * ("Software"), with or without modification, are permitted provided that the
185 |  | * following conditions are met:
186 |  | *
187 |  | * 1. Redistributions of source code must retain copyright statements and
188 |  | * notices. Redistributions must also contain a copy of this document.
189 |  | *
190 |  | * 2. Redistributions in binary form must reproduce the above copyright notice,
191 |  | * this list of conditions and the following disclaimer in the documentation
192 |  | * and/or other materials provided with the distribution.
193 |  | *
194 |  | * 3. The name "DOM4J" must not be used to endorse or promote products derived
195 |  | * from this Software without prior written permission of MetaStuff, Ltd. For
196 |  | * written permission, please contact dom4j-info@metastuff.com.
197 |  | *
198 |  | * 4. Products derived from this Software may not be called "DOM4J" nor may
199 |  | * "DOM4J" appear in their names without prior written permission of MetaStuff,
200 |  | * Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
201 |  | *
202 |  | * 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
203 |  | *
204 |  | * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
205 |  | * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
206 |  | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
207 |  | * ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
208 |  | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
209 |  | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
210 |  | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
211 |  | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
212 |  | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
213 |  | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
214 |  | * POSSIBILITY OF SUCH DAMAGE.
215 |  | *
216 |  | * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
217 |  | */