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