Clover coverage report - dom4j - 1.5
Coverage timestamp: vr sep 3 2004 20:47:03 GMT+01:00
file stats: LOC: 244   Methods: 36
NCLOC: 129   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
DOMComment.java - 2,6% 2,8% 2,7%
coverage coverage
 1    /*
 2    * Copyright 2001-2004 (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    * $Id: DOMComment.java,v 1.10 2004/06/25 08:03:35 maartenc Exp $
 8    */
 9   
 10    package org.dom4j.dom;
 11   
 12    import org.dom4j.Element;
 13    import org.dom4j.tree.DefaultComment;
 14    import org.w3c.dom.DOMException;
 15    import org.w3c.dom.Document;
 16    import org.w3c.dom.NamedNodeMap;
 17    import org.w3c.dom.NodeList;
 18   
 19    /** <p><code>DOMText</code> implements a Text node which
 20    * supports the W3C DOM API.</p>
 21    *
 22    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
 23    * @version $Revision: 1.10 $
 24    */
 25    public class DOMComment extends DefaultComment implements org.w3c.dom.Comment {
 26   
 27  18 public DOMComment(String text) {
 28  18 super(text);
 29    }
 30   
 31  0 public DOMComment(Element parent,String text) {
 32  0 super(parent, text);
 33    }
 34   
 35   
 36   
 37    // org.w3c.dom.Node interface
 38    //-------------------------------------------------------------------------
 39  0 public boolean supports(String feature, String version) {
 40  0 return DOMNodeHelper.supports(this, feature, version);
 41    }
 42   
 43  0 public String getNamespaceURI() {
 44  0 return DOMNodeHelper.getNamespaceURI(this);
 45    }
 46   
 47  0 public String getPrefix() {
 48  0 return DOMNodeHelper.getPrefix(this);
 49    }
 50   
 51  0 public void setPrefix(String prefix) throws DOMException {
 52  0 DOMNodeHelper.setPrefix(this, prefix);
 53    }
 54   
 55  0 public String getLocalName() {
 56  0 return DOMNodeHelper.getLocalName(this);
 57    }
 58   
 59  0 public String getNodeName() {
 60  0 return "#comment";
 61    }
 62   
 63    //already part of API
 64    //
 65    //public short getNodeType();
 66   
 67   
 68   
 69  0 public String getNodeValue() throws DOMException {
 70  0 return DOMNodeHelper.getNodeValue(this);
 71    }
 72   
 73  0 public void setNodeValue(String nodeValue) throws DOMException {
 74  0 DOMNodeHelper.setNodeValue(this, nodeValue);
 75    }
 76   
 77   
 78  0 public org.w3c.dom.Node getParentNode() {
 79  0 return DOMNodeHelper.getParentNode(this);
 80    }
 81   
 82  0 public NodeList getChildNodes() {
 83  0 return DOMNodeHelper.getChildNodes(this);
 84    }
 85   
 86  0 public org.w3c.dom.Node getFirstChild() {
 87  0 return DOMNodeHelper.getFirstChild(this);
 88    }
 89   
 90  0 public org.w3c.dom.Node getLastChild() {
 91  0 return DOMNodeHelper.getLastChild(this);
 92    }
 93   
 94  0 public org.w3c.dom.Node getPreviousSibling() {
 95  0 return DOMNodeHelper.getPreviousSibling(this);
 96    }
 97   
 98  0 public org.w3c.dom.Node getNextSibling() {
 99  0 return DOMNodeHelper.getNextSibling(this);
 100    }
 101   
 102  0 public NamedNodeMap getAttributes() {
 103  0 return null;
 104    }
 105   
 106  0 public Document getOwnerDocument() {
 107  0 return DOMNodeHelper.getOwnerDocument(this);
 108    }
 109   
 110  0 public org.w3c.dom.Node insertBefore(
 111    org.w3c.dom.Node newChild,
 112    org.w3c.dom.Node refChild
 113    ) throws DOMException {
 114  0 checkNewChildNode(newChild);
 115  0 return DOMNodeHelper.insertBefore(this, newChild, refChild);
 116    }
 117   
 118  0 public org.w3c.dom.Node replaceChild(
 119    org.w3c.dom.Node newChild,
 120    org.w3c.dom.Node oldChild
 121    ) throws DOMException {
 122  0 checkNewChildNode(newChild);
 123  0 return DOMNodeHelper.replaceChild(this, newChild, oldChild);
 124    }
 125   
 126  0 public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws DOMException {
 127  0 return DOMNodeHelper.removeChild(this, oldChild);
 128    }
 129   
 130  0 public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws DOMException {
 131  0 checkNewChildNode(newChild);
 132  0 return DOMNodeHelper.appendChild(this, newChild);
 133    }
 134   
 135  0 private final void checkNewChildNode(org.w3c.dom.Node newChild) throws DOMException {
 136  0 throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
 137    "Comment nodes cannot have children");
 138    }
 139   
 140   
 141  0 public boolean hasChildNodes() {
 142  0 return DOMNodeHelper.hasChildNodes(this);
 143    }
 144   
 145  0 public org.w3c.dom.Node cloneNode(boolean deep) {
 146  0 return DOMNodeHelper.cloneNode(this, deep);
 147    }
 148   
 149  0 public void normalize() {
 150  0 DOMNodeHelper.normalize(this);
 151    }
 152   
 153  0 public boolean isSupported(String feature, String version) {
 154  0 return DOMNodeHelper.isSupported(this, feature, version);
 155    }
 156   
 157  0 public boolean hasAttributes() {
 158  0 return DOMNodeHelper.hasAttributes(this);
 159    }
 160   
 161    // org.w3c.dom.CharacterData interface
 162    //-------------------------------------------------------------------------
 163  0 public String getData() throws DOMException {
 164  0 return DOMNodeHelper.getData(this);
 165    }
 166   
 167  0 public void setData(String data) throws DOMException {
 168  0 DOMNodeHelper.setData(this, data);
 169    }
 170   
 171  0 public int getLength() {
 172  0 return DOMNodeHelper.getLength(this);
 173    }
 174   
 175  0 public String substringData( int offset, int count) throws DOMException {
 176  0 return DOMNodeHelper.substringData(this, offset, count);
 177    }
 178   
 179  0 public void appendData(String arg) throws DOMException {
 180  0 DOMNodeHelper.appendData(this, arg);
 181    }
 182   
 183  0 public void insertData(int offset, String arg) throws DOMException {
 184  0 DOMNodeHelper.insertData(this, offset, arg);
 185    }
 186   
 187  0 public void deleteData(int offset, int count) throws DOMException {
 188  0 DOMNodeHelper.deleteData(this, offset, count);
 189    }
 190   
 191  0 public void replaceData(
 192    int offset, int count, String arg
 193    ) throws DOMException {
 194  0 DOMNodeHelper.replaceData(this, offset, count, arg);
 195    }
 196    }
 197   
 198   
 199   
 200   
 201    /*
 202    * Redistribution and use of this software and associated documentation
 203    * ("Software"), with or without modification, are permitted provided
 204    * that the following conditions are met:
 205    *
 206    * 1. Redistributions of source code must retain copyright
 207    * statements and notices. Redistributions must also contain a
 208    * copy of this document.
 209    *
 210    * 2. Redistributions in binary form must reproduce the
 211    * above copyright notice, this list of conditions and the
 212    * following disclaimer in the documentation and/or other
 213    * materials provided with the distribution.
 214    *
 215    * 3. The name "DOM4J" must not be used to endorse or promote
 216    * products derived from this Software without prior written
 217    * permission of MetaStuff, Ltd. For written permission,
 218    * please contact dom4j-info@metastuff.com.
 219    *
 220    * 4. Products derived from this Software may not be called "DOM4J"
 221    * nor may "DOM4J" appear in their names without prior written
 222    * permission of MetaStuff, Ltd. DOM4J is a registered
 223    * trademark of MetaStuff, Ltd.
 224    *
 225    * 5. Due credit should be given to the DOM4J Project -
 226    * http://www.dom4j.org
 227    *
 228    * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
 229    * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
 230    * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 231    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 232    * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 233    * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 234    * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 235    * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 236    * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 237    * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 238    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 239    * OF THE POSSIBILITY OF SUCH DAMAGE.
 240    *
 241    * Copyright 2001-2004 (C) MetaStuff, Ltd. All Rights Reserved.
 242    *
 243    * $Id: DOMComment.java,v 1.10 2004/06/25 08:03:35 maartenc Exp $
 244    */