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: | 120 |  | Methods: | 9
| NCLOC: | 52 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
DocumentException.java | 0% | 9,1% | 11,1% | 7,7% |

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;
9 |  |
10 |  | import java.io.PrintStream;
11 |  | import java.io.PrintWriter;
12 |  |
13 |  | /**
14 |  | * <p>
15 |  | * <code>DocumentException</code> is a nested Exception which may be thrown
16 |  | * during the processing of a DOM4J document.
17 |  | * </p>
18 |  | *
19 |  | * @author <a href="mailto:james.strachan@metastuff.com">James Strachan </a>
20 |  | * @version $Revision: 1.7 $
21 |  | */
22 |  | public class DocumentException extends Exception {
23 |  | /** A wrapped <code>Throwable</code> */
24 |  | private Throwable nestedException;
25 |  |
26 | 0 | public DocumentException() {
27 | 0 | super("Error occurred in DOM4J application.");
28 |  | }
29 |  |
30 | 0 | public DocumentException(String message) {
31 | 0 | super(message);
32 |  | }
33 |  |
34 | 0 | public DocumentException(Throwable nestedException) {
35 | 0 | super(nestedException.getMessage());
36 | 0 | this.nestedException = nestedException;
37 |  | }
38 |  |
39 | 1 | public DocumentException(String message, Throwable nestedException) {
40 | 1 | super(message);
41 | 1 | this.nestedException = nestedException;
42 |  | }
43 |  |
44 | 0 | public Throwable getNestedException() {
45 | 0 | return nestedException;
46 |  | }
47 |  |
48 | 0 | public String getMessage() {
49 | 0 | if (nestedException != null) {
50 | 0 | return super.getMessage() + " Nested exception: "
51 |  | + nestedException.getMessage();
52 |  | } else {
53 | 0 | return super.getMessage();
54 |  | }
55 |  | }
56 |  |
57 | 0 | public void printStackTrace() {
58 | 0 | super.printStackTrace();
59 |  |
60 | 0 | if (nestedException != null) {
61 | 0 | System.err.print("Nested exception: ");
62 | 0 | nestedException.printStackTrace();
63 |  | }
64 |  | }
65 |  |
66 | 0 | public void printStackTrace(PrintStream out) {
67 | 0 | super.printStackTrace(out);
68 |  |
69 | 0 | if (nestedException != null) {
70 | 0 | out.println("Nested exception: ");
71 | 0 | nestedException.printStackTrace(out);
72 |  | }
73 |  | }
74 |  |
75 | 0 | public void printStackTrace(PrintWriter writer) {
76 | 0 | super.printStackTrace(writer);
77 |  |
78 | 0 | if (nestedException != null) {
79 | 0 | writer.println("Nested exception: ");
80 | 0 | nestedException.printStackTrace(writer);
81 |  | }
82 |  | }
83 |  | }
84 |  |
85 |  | /*
86 |  | * Redistribution and use of this software and associated documentation
87 |  | * ("Software"), with or without modification, are permitted provided that the
88 |  | * following conditions are met:
89 |  | *
90 |  | * 1. Redistributions of source code must retain copyright statements and
91 |  | * notices. Redistributions must also contain a copy of this document.
92 |  | *
93 |  | * 2. Redistributions in binary form must reproduce the above copyright notice,
94 |  | * this list of conditions and the following disclaimer in the documentation
95 |  | * and/or other materials provided with the distribution.
96 |  | *
97 |  | * 3. The name "DOM4J" must not be used to endorse or promote products derived
98 |  | * from this Software without prior written permission of MetaStuff, Ltd. For
99 |  | * written permission, please contact dom4j-info@metastuff.com.
100 |  | *
101 |  | * 4. Products derived from this Software may not be called "DOM4J" nor may
102 |  | * "DOM4J" appear in their names without prior written permission of MetaStuff,
103 |  | * Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
104 |  | *
105 |  | * 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
106 |  | *
107 |  | * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
108 |  | * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
109 |  | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
110 |  | * ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
111 |  | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
112 |  | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
113 |  | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
114 |  | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
115 |  | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
116 |  | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
117 |  | * POSSIBILITY OF SUCH DAMAGE.
118 |  | *
119 |  | * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
120 |  | */