|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
PicoException.java | - | 100% | 100% | 100% |
|
1 |
/*****************************************************************************
|
|
2 |
* Copyright (C) PicoContainer Organization. All rights reserved. *
|
|
3 |
* ------------------------------------------------------------------------- *
|
|
4 |
* The software in this package is published under the terms of the BSD *
|
|
5 |
* style license a copy of which has been included with this distribution in *
|
|
6 |
* the LICENSE.txt file. *
|
|
7 |
* *
|
|
8 |
* Original code by *
|
|
9 |
*****************************************************************************/
|
|
10 |
package org.picocontainer;
|
|
11 |
|
|
12 |
/**
|
|
13 |
* Superclass for all Exceptions in PicoContainer. You can use this if you want to catch all exceptions thrown by
|
|
14 |
* PicoContainer. Be aware that some parts of the PicoContainer API will also throw {@link NullPointerException} when
|
|
15 |
* <code>null</code> values are provided for method arguments, and this is not allowed.
|
|
16 |
*
|
|
17 |
* @author Paul Hammant
|
|
18 |
* @author Aslak Hellesøy
|
|
19 |
* @version $Revision: 1.10 $
|
|
20 |
* @since 1.0
|
|
21 |
*/
|
|
22 |
public abstract class PicoException extends RuntimeException { |
|
23 |
/**
|
|
24 |
* The exception that caused this one.
|
|
25 |
*/
|
|
26 |
private Throwable cause;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* Construct a new exception with no cause and no detail message. Note modern JVMs may still track the exception
|
|
30 |
* that caused this one.
|
|
31 |
*/
|
|
32 | 17 |
protected PicoException() {
|
33 |
} |
|
34 |
|
|
35 |
/**
|
|
36 |
* Construct a new exception with no cause and the specified detail message. Note modern JVMs may still track the
|
|
37 |
* exception that caused this one.
|
|
38 |
*
|
|
39 |
* @param message the message detailing the exception.
|
|
40 |
*/
|
|
41 | 19 |
protected PicoException(final String message) {
|
42 | 19 |
super(message);
|
43 |
} |
|
44 |
|
|
45 |
/**
|
|
46 |
* Construct a new exception with the specified cause and no detail message.
|
|
47 |
*
|
|
48 |
* @param cause the exception that caused this one.
|
|
49 |
*/
|
|
50 | 1 |
protected PicoException(final Throwable cause) {
|
51 | 1 |
this.cause = cause;
|
52 |
} |
|
53 |
|
|
54 |
/**
|
|
55 |
* Construct a new exception with the specified cause and the specified detail message.
|
|
56 |
*
|
|
57 |
* @param message the message detailing the exception.
|
|
58 |
* @param cause the exception that caused this one.
|
|
59 |
*/
|
|
60 | 3 |
protected PicoException(final String message, final Throwable cause) {
|
61 | 3 |
super(message);
|
62 | 3 |
this.cause = cause;
|
63 |
} |
|
64 |
|
|
65 |
/**
|
|
66 |
* Retrieve the exception that caused this one.
|
|
67 |
*
|
|
68 |
* @return the exception that caused this one, or null if it was not set.
|
|
69 |
* @see Throwable#getCause() the method available since JDK 1.3 that is overridden by this method.
|
|
70 |
*/
|
|
71 | 2 |
public Throwable getCause() {
|
72 | 2 |
return cause;
|
73 |
} |
|
74 |
} |
|
75 |
|
|