22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 /* 26 * $Id: NoSuchMechanismException.java,v 1.4 2005/05/10 15:47:42 mullan Exp $ 27 */ 28 package javax.xml.crypto; 29 30 import java.io.PrintStream; 31 import java.io.PrintWriter; 32 import javax.xml.crypto.dsig.Manifest; 33 import javax.xml.crypto.dsig.XMLSignature; 34 import javax.xml.crypto.dsig.XMLSignatureFactory; 35 import javax.xml.crypto.dsig.keyinfo.KeyInfo; 36 import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory; 37 38 /** 39 * This exception is thrown when a particular XML mechanism is requested but 40 * is not available in the environment. 41 * 42 * <p>A <code>NoSuchMechanismException</code> can contain a cause: another 43 * throwable that caused this <code>NoSuchMechanismException</code> to get 44 * thrown. 45 * 46 * @author Sean Mullan 47 * @author JSR 105 Expert Group 48 * @since 1.6 49 * @see XMLSignatureFactory#getInstance XMLSignatureFactory.getInstance 50 * @see KeyInfoFactory#getInstance KeyInfoFactory.getInstance 51 */ 52 public class NoSuchMechanismException extends RuntimeException { 53 54 private static final long serialVersionUID = 4189669069570660166L; 55 56 /** 57 * The throwable that caused this exception to get thrown, or null if this 58 * exception was not caused by another throwable or if the causative 59 * throwable is unknown. 60 * 61 * @serial 62 */ 63 private Throwable cause; 64 65 /** 66 * Constructs a new <code>NoSuchMechanismException</code> with 67 * <code>null</code> as its detail message. 68 */ 69 public NoSuchMechanismException() { 70 super(); 71 } 72 73 /** 74 * Constructs a new <code>NoSuchMechanismException</code> with the 75 * specified detail message. 76 * 77 * @param message the detail message 78 */ 79 public NoSuchMechanismException(String message) { 80 super(message); 81 } 82 83 /** 84 * Constructs a new <code>NoSuchMechanismException</code> with the 85 * specified detail message and cause. 86 * <p>Note that the detail message associated with 87 * <code>cause</code> is <i>not</i> automatically incorporated in 88 * this exception's detail message. 89 * 90 * @param message the detail message 91 * @param cause the cause (A <tt>null</tt> value is permitted, and 92 * indicates that the cause is nonexistent or unknown.) 93 */ 94 public NoSuchMechanismException(String message, Throwable cause) { 95 super(message); 96 this.cause = cause; 97 } 98 99 /** 100 * Constructs a new <code>NoSuchMechanismException</code> with the 101 * specified cause and a detail message of 102 * <code>(cause==null ? null : cause.toString())</code> (which typically 103 * contains the class and detail message of <code>cause</code>). 104 * 105 * @param cause the cause (A <tt>null</tt> value is permitted, and 106 * indicates that the cause is nonexistent or unknown.) 107 */ 108 public NoSuchMechanismException(Throwable cause) { 109 super(cause==null ? null : cause.toString()); 110 this.cause = cause; 111 } 112 113 /** 114 * Returns the cause of this <code>NoSuchMechanismException</code> or 115 * <code>null</code> if the cause is nonexistent or unknown. (The 116 * cause is the throwable that caused this 117 * <code>NoSuchMechanismException</code> to get thrown.) 118 * 119 * @return the cause of this <code>NoSuchMechanismException</code> or 120 * <code>null</code> if the cause is nonexistent or unknown. 121 */ 122 public Throwable getCause() { 123 return cause; 124 } 125 126 /** 127 * Prints this <code>NoSuchMechanismException</code>, its backtrace and 128 * the cause's backtrace to the standard error stream. 129 */ 130 public void printStackTrace() { 131 super.printStackTrace(); 132 //XXX print backtrace of cause 133 } 134 135 /** 136 * Prints this <code>NoSuchMechanismException</code>, its backtrace and 137 * the cause's backtrace to the specified print stream. 138 * 139 * @param s <code>PrintStream</code> to use for output 140 */ 141 public void printStackTrace(PrintStream s) { 142 super.printStackTrace(s); 143 //XXX print backtrace of cause 144 } 145 146 /** 147 * Prints this <code>NoSuchMechanismException</code>, its backtrace and 148 * the cause's backtrace to the specified print writer. 149 * 150 * @param s <code>PrintWriter</code> to use for output 151 */ 152 public void printStackTrace(PrintWriter s) { 153 super.printStackTrace(s); 154 //XXX print backtrace of cause 155 } 156 } | 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 /* 26 * $Id: NoSuchMechanismException.java,v 1.4 2005/05/10 15:47:42 mullan Exp $ 27 */ 28 package javax.xml.crypto; 29 30 import java.io.PrintStream; 31 import java.io.PrintWriter; 32 import javax.xml.crypto.dsig.Manifest; 33 import javax.xml.crypto.dsig.XMLSignature; 34 import javax.xml.crypto.dsig.XMLSignatureFactory; 35 import javax.xml.crypto.dsig.keyinfo.KeyInfo; 36 import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory; 37 38 /** 39 * This exception is thrown when a particular XML mechanism is requested but 40 * is not available in the environment. 41 * 42 * <p>A {@code NoSuchMechanismException} can contain a cause: another 43 * throwable that caused this {@code NoSuchMechanismException} to get 44 * thrown. 45 * 46 * @author Sean Mullan 47 * @author JSR 105 Expert Group 48 * @since 1.6 49 * @see XMLSignatureFactory#getInstance XMLSignatureFactory.getInstance 50 * @see KeyInfoFactory#getInstance KeyInfoFactory.getInstance 51 */ 52 public class NoSuchMechanismException extends RuntimeException { 53 54 private static final long serialVersionUID = 4189669069570660166L; 55 56 /** 57 * The throwable that caused this exception to get thrown, or null if this 58 * exception was not caused by another throwable or if the causative 59 * throwable is unknown. 60 * 61 * @serial 62 */ 63 private Throwable cause; 64 65 /** 66 * Constructs a new {@code NoSuchMechanismException} with 67 * {@code null} as its detail message. 68 */ 69 public NoSuchMechanismException() { 70 super(); 71 } 72 73 /** 74 * Constructs a new {@code NoSuchMechanismException} with the 75 * specified detail message. 76 * 77 * @param message the detail message 78 */ 79 public NoSuchMechanismException(String message) { 80 super(message); 81 } 82 83 /** 84 * Constructs a new {@code NoSuchMechanismException} with the 85 * specified detail message and cause. 86 * <p>Note that the detail message associated with 87 * {@code cause} is <i>not</i> automatically incorporated in 88 * this exception's detail message. 89 * 90 * @param message the detail message 91 * @param cause the cause (A {@code null} value is permitted, and 92 * indicates that the cause is nonexistent or unknown.) 93 */ 94 public NoSuchMechanismException(String message, Throwable cause) { 95 super(message); 96 this.cause = cause; 97 } 98 99 /** 100 * Constructs a new {@code NoSuchMechanismException} with the 101 * specified cause and a detail message of 102 * {@code (cause==null ? null : cause.toString())} (which typically 103 * contains the class and detail message of {@code cause}). 104 * 105 * @param cause the cause (A {@code null} value is permitted, and 106 * indicates that the cause is nonexistent or unknown.) 107 */ 108 public NoSuchMechanismException(Throwable cause) { 109 super(cause==null ? null : cause.toString()); 110 this.cause = cause; 111 } 112 113 /** 114 * Returns the cause of this {@code NoSuchMechanismException} or 115 * {@code null} if the cause is nonexistent or unknown. (The 116 * cause is the throwable that caused this 117 * {@code NoSuchMechanismException} to get thrown.) 118 * 119 * @return the cause of this {@code NoSuchMechanismException} or 120 * {@code null} if the cause is nonexistent or unknown. 121 */ 122 public Throwable getCause() { 123 return cause; 124 } 125 126 /** 127 * Prints this {@code NoSuchMechanismException}, its backtrace and 128 * the cause's backtrace to the standard error stream. 129 */ 130 public void printStackTrace() { 131 super.printStackTrace(); 132 //XXX print backtrace of cause 133 } 134 135 /** 136 * Prints this {@code NoSuchMechanismException}, its backtrace and 137 * the cause's backtrace to the specified print stream. 138 * 139 * @param s {@code PrintStream} to use for output 140 */ 141 public void printStackTrace(PrintStream s) { 142 super.printStackTrace(s); 143 //XXX print backtrace of cause 144 } 145 146 /** 147 * Prints this {@code NoSuchMechanismException}, its backtrace and 148 * the cause's backtrace to the specified print writer. 149 * 150 * @param s {@code PrintWriter} to use for output 151 */ 152 public void printStackTrace(PrintWriter s) { 153 super.printStackTrace(s); 154 //XXX print backtrace of cause 155 } 156 } |