Clover coverage report - dom4j - 1.5
Coverage timestamp: vr sep 3 2004 20:47:03 GMT+01:00
file stats: LOC: 218   Methods: 29
NCLOC: 113   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
DOMEntityReference.java 0% 0% 0% 0%
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: DOMEntityReference.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.DefaultEntity;
 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>DOMEntity</code> implements a Entity 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 DOMEntityReference extends DefaultEntity implements org.w3c.dom.EntityReference {
 26   
 27  0 public DOMEntityReference(String name) {
 28  0 super( name );
 29    }
 30   
 31  0 public DOMEntityReference(String name, String text) {
 32  0 super( name, text );
 33    }
 34   
 35  0 public DOMEntityReference(Element parent, String name, String text) {
 36  0 super( parent, name, text );
 37    }
 38   
 39   
 40    // org.w3c.dom.Node interface
 41    //-------------------------------------------------------------------------
 42  0 public boolean supports(String feature, String version) {
 43  0 return DOMNodeHelper.supports(this, feature, version);
 44    }
 45   
 46  0 public String getNamespaceURI() {
 47  0 return DOMNodeHelper.getNamespaceURI(this);
 48    }
 49   
 50  0 public String getPrefix() {
 51  0 return DOMNodeHelper.getPrefix(this);
 52    }
 53   
 54  0 public void setPrefix(String prefix) throws DOMException {
 55  0 DOMNodeHelper.setPrefix(this, prefix);
 56    }
 57   
 58  0 public String getLocalName() {
 59  0 return DOMNodeHelper.getLocalName(this);
 60    }
 61   
 62  0 public String getNodeName() {
 63  0 return getName();
 64    }
 65   
 66    //already part of API
 67    //
 68    //public short getNodeType();
 69   
 70   
 71   
 72  0 public String getNodeValue() throws DOMException {
 73  0 return null;
 74    }
 75   
 76  0 public void setNodeValue(String nodeValue) throws DOMException {
 77    }
 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(
 113    org.w3c.dom.Node newChild,
 114    org.w3c.dom.Node refChild
 115    ) throws DOMException {
 116  0 checkNewChildNode(newChild);
 117  0 return DOMNodeHelper.insertBefore(this, newChild, refChild);
 118    }
 119   
 120  0 public org.w3c.dom.Node replaceChild(
 121    org.w3c.dom.Node newChild,
 122    org.w3c.dom.Node oldChild
 123    ) throws DOMException {
 124  0 checkNewChildNode(newChild);
 125  0 return DOMNodeHelper.replaceChild(this, newChild, oldChild);
 126    }
 127   
 128  0 public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws DOMException {
 129  0 return DOMNodeHelper.removeChild(this, oldChild);
 130    }
 131   
 132  0 public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws DOMException {
 133  0 checkNewChildNode(newChild);
 134  0 return DOMNodeHelper.appendChild(this, newChild);
 135    }
 136   
 137  0 private void checkNewChildNode(org.w3c.dom.Node newChild) throws DOMException {
 138  0 final int nodeType = newChild.getNodeType();
 139  0 if (!(nodeType == org.w3c.dom.Node.ELEMENT_NODE ||
 140    nodeType == org.w3c.dom.Node.TEXT_NODE ||
 141    nodeType == org.w3c.dom.Node.COMMENT_NODE ||
 142    nodeType == org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE ||
 143    nodeType == org.w3c.dom.Node.CDATA_SECTION_NODE ||
 144    nodeType == org.w3c.dom.Node.ENTITY_REFERENCE_NODE)) {
 145  0 throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
 146    "Specified node cannot be a child of an entity reference");
 147    }
 148    }
 149   
 150   
 151  0 public boolean hasChildNodes() {
 152  0 return DOMNodeHelper.hasChildNodes(this);
 153    }
 154   
 155  0 public org.w3c.dom.Node cloneNode(boolean deep) {
 156  0 return DOMNodeHelper.cloneNode(this, deep);
 157    }
 158   
 159  0 public void normalize() {
 160  0 DOMNodeHelper.normalize(this);
 161    }
 162   
 163  0 public boolean isSupported(String feature, String version) {
 164  0 return DOMNodeHelper.isSupported(this, feature, version);
 165    }
 166   
 167  0 public boolean hasAttributes() {
 168  0 return DOMNodeHelper.hasAttributes(this);
 169    }
 170    }
 171   
 172   
 173   
 174   
 175    /*
 176    * Redistribution and use of this software and associated documentation
 177    * ("Software"), with or without modification, are permitted provided
 178    * that the following conditions are met:
 179    *
 180    * 1. Redistributions of source code must retain copyright
 181    * statements and notices. Redistributions must also contain a
 182    * copy of this document.
 183    *
 184    * 2. Redistributions in binary form must reproduce the
 185    * above copyright notice, this list of conditions and the
 186    * following disclaimer in the documentation and/or other
 187    * materials provided with the distribution.
 188    *
 189    * 3. The name "DOM4J" must not be used to endorse or promote
 190    * products derived from this Software without prior written
 191    * permission of MetaStuff, Ltd. For written permission,
 192    * please contact dom4j-info@metastuff.com.
 193    *
 194    * 4. Products derived from this Software may not be called "DOM4J"
 195    * nor may "DOM4J" appear in their names without prior written
 196    * permission of MetaStuff, Ltd. DOM4J is a registered
 197    * trademark of MetaStuff, Ltd.
 198    *
 199    * 5. Due credit should be given to the DOM4J Project -
 200    * http://www.dom4j.org
 201    *
 202    * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
 203    * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
 204    * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 205    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 206    * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 207    * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 208    * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 209    * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 210    * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 211    * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 212    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 213    * OF THE POSSIBILITY OF SUCH DAMAGE.
 214    *
 215    * Copyright 2001-2004 (C) MetaStuff, Ltd. All Rights Reserved.
 216    *
 217    * $Id: DOMEntityReference.java,v 1.10 2004/06/25 08:03:35 maartenc Exp $
 218    */