KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > crypto > KeySelectorException


1 /*
2  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3  */

4 /*
5  * $Id: KeySelectorException.java,v 1.3 2005/05/10 15:47:42 mullan Exp $
6  */

7 package javax.xml.crypto;
8
9 import java.io.PrintStream JavaDoc;
10 import java.io.PrintWriter JavaDoc;
11
12 /**
13  * Indicates an exceptional condition thrown by a {@link KeySelector}.
14  *
15  * <p>A <code>KeySelectorException</code> can contain a cause: another
16  * throwable that caused this <code>KeySelectorException</code> to get thrown.
17  *
18  * @author Sean Mullan
19  * @author JSR 105 Expert Group
20  * @since 1.6
21  */

22 public class KeySelectorException extends Exception JavaDoc {
23
24     private static final long serialVersionUID = -7480033639322531109L;
25
26     /**
27      * The throwable that caused this exception to get thrown, or
28      * <code>null</code> if this exception was not caused by another throwable
29      * or if the causative throwable is unknown.
30      *
31      * @serial
32      */

33     private Throwable JavaDoc cause;
34
35     /**
36      * Constructs a new <code>KeySelectorException</code> with
37      * <code>null</code> as its detail message.
38      */

39     public KeySelectorException() {
40         super();
41     }
42
43     /**
44      * Constructs a new <code>KeySelectorException</code> with the specified
45      * detail message.
46      *
47      * @param message the detail message
48      */

49     public KeySelectorException(String JavaDoc message) {
50         super(message);
51     }
52
53     /**
54      * Constructs a new <code>KeySelectorException</code> with the
55      * specified detail message and cause.
56      * <p>Note that the detail message associated with
57      * <code>cause</code> is <i>not</i> automatically incorporated in
58      * this exception's detail message.
59      *
60      * @param message the detail message
61      * @param cause the cause (A <tt>null</tt> value is permitted, and
62      * indicates that the cause is nonexistent or unknown.)
63      */

64     public KeySelectorException(String JavaDoc message, Throwable JavaDoc cause) {
65         super(message);
66         this.cause = cause;
67     }
68
69     /**
70      * Constructs a new <code>KeySelectorException</code> with the specified
71      * cause and a detail message of
72      * <code>(cause==null ? null : cause.toString())</code>
73      * (which typically contains the class and detail message of
74      * <code>cause</code>).
75      *
76      * @param cause the cause (A <tt>null</tt> value is permitted, and
77      * indicates that the cause is nonexistent or unknown.)
78      */

79     public KeySelectorException(Throwable JavaDoc cause) {
80         super(cause==null ? null : cause.toString());
81         this.cause = cause;
82     }
83
84     /**
85      * Returns the cause of this <code>KeySelectorException</code> or
86      * <code>null</code> if the cause is nonexistent or unknown. (The
87      * cause is the throwable that caused this
88      * <code>KeySelectorException</code> to get thrown.)
89      *
90      * @return the cause of this <code>KeySelectorException</code> or
91      * <code>null</code> if the cause is nonexistent or unknown.
92      */

93     public Throwable JavaDoc getCause() {
94         return cause;
95     }
96
97     /**
98      * Prints this <code>KeySelectorException</code>, its backtrace and
99      * the cause's backtrace to the standard error stream.
100      */

101     public void printStackTrace() {
102     super.printStackTrace();
103     //XXX print backtrace of cause
104
}
105
106     /**
107      * Prints this <code>KeySelectorException</code>, its backtrace and
108      * the cause's backtrace to the specified print stream.
109      *
110      * @param s <code>PrintStream</code> to use for output
111      */

112     public void printStackTrace(PrintStream JavaDoc s) {
113     super.printStackTrace(s);
114     //XXX print backtrace of cause
115
}
116
117     /**
118      * Prints this <code>KeySelectorException</code>, its backtrace and
119      * the cause's backtrace to the specified print writer.
120      *
121      * @param s <code>PrintWriter</code> to use for output
122      */

123     public void printStackTrace(PrintWriter JavaDoc s) {
124         super.printStackTrace(s);
125     //XXX print backtrace of cause
126
}
127 }
128
Popular Tags