0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A/*
0N/A * $Id: MarshalException.java,v 1.5 2005/05/10 15:47:42 mullan Exp $
0N/A */
0N/Apackage javax.xml.crypto;
0N/A
0N/Aimport java.io.PrintStream;
0N/Aimport java.io.PrintWriter;
0N/Aimport javax.xml.crypto.dsig.Manifest;
0N/Aimport javax.xml.crypto.dsig.XMLSignature;
0N/Aimport javax.xml.crypto.dsig.XMLSignatureFactory;
0N/Aimport javax.xml.crypto.dsig.keyinfo.KeyInfo;
0N/Aimport javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
0N/A
0N/A/**
0N/A * Indicates an exceptional condition that occured during the XML
0N/A * marshalling or unmarshalling process.
0N/A *
0N/A * <p>A <code>MarshalException</code> can contain a cause: another
0N/A * throwable that caused this <code>MarshalException</code> to get thrown.
0N/A *
0N/A * @author Sean Mullan
0N/A * @author JSR 105 Expert Group
0N/A * @since 1.6
0N/A * @see XMLSignature#sign(XMLSignContext)
0N/A * @see XMLSignatureFactory#unmarshalXMLSignature(XMLValidateContext)
0N/A */
0N/Apublic class MarshalException extends Exception {
0N/A
0N/A private static final long serialVersionUID = -863185580332643547L;
0N/A
0N/A /**
0N/A * The throwable that caused this exception to get thrown, or null if this
0N/A * exception was not caused by another throwable or if the causative
0N/A * throwable is unknown.
0N/A *
0N/A * @serial
0N/A */
0N/A private Throwable cause;
0N/A
0N/A /**
0N/A * Constructs a new <code>MarshalException</code> with
0N/A * <code>null</code> as its detail message.
0N/A */
0N/A public MarshalException() {
0N/A super();
0N/A }
0N/A
0N/A /**
0N/A * Constructs a new <code>MarshalException</code> with the specified
0N/A * detail message.
0N/A *
0N/A * @param message the detail message
0N/A */
0N/A public MarshalException(String message) {
0N/A super(message);
0N/A }
0N/A
0N/A /**
0N/A * Constructs a new <code>MarshalException</code> with the
0N/A * specified detail message and cause.
0N/A * <p>Note that the detail message associated with
0N/A * <code>cause</code> is <i>not</i> automatically incorporated in
0N/A * this exception's detail message.
0N/A *
0N/A * @param message the detail message
0N/A * @param cause the cause (A <tt>null</tt> value is permitted, and
0N/A * indicates that the cause is nonexistent or unknown.)
0N/A */
0N/A public MarshalException(String message, Throwable cause) {
0N/A super(message);
0N/A this.cause = cause;
0N/A }
0N/A
0N/A /**
0N/A * Constructs a new <code>MarshalException</code> with the specified cause
0N/A * and a detail message of <code>(cause==null ? null : cause.toString())
0N/A * </code> (which typically contains the class and detail message of
0N/A * <code>cause</code>).
0N/A *
0N/A * @param cause the cause (A <tt>null</tt> value is permitted, and
0N/A * indicates that the cause is nonexistent or unknown.)
0N/A */
0N/A public MarshalException(Throwable cause) {
0N/A super(cause==null ? null : cause.toString());
0N/A this.cause = cause;
0N/A }
0N/A
0N/A /**
0N/A * Returns the cause of this <code>MarshalException</code> or
0N/A * <code>null</code> if the cause is nonexistent or unknown. (The
0N/A * cause is the throwable that caused this
0N/A * <code>MarshalException</code> to get thrown.)
0N/A *
0N/A * @return the cause of this <code>MarshalException</code> or
0N/A * <code>null</code> if the cause is nonexistent or unknown.
0N/A */
0N/A public Throwable getCause() {
0N/A return cause;
0N/A }
0N/A
0N/A /**
0N/A * Prints this <code>MarshalException</code>, its backtrace and
0N/A * the cause's backtrace to the standard error stream.
0N/A */
0N/A public void printStackTrace() {
0N/A super.printStackTrace();
0N/A //XXX print backtrace of cause
0N/A }
0N/A
0N/A /**
0N/A * Prints this <code>MarshalException</code>, its backtrace and
0N/A * the cause's backtrace to the specified print stream.
0N/A *
0N/A * @param s <code>PrintStream</code> to use for output
0N/A */
0N/A public void printStackTrace(PrintStream s) {
0N/A super.printStackTrace(s);
0N/A //XXX print backtrace of cause
0N/A }
0N/A
0N/A /**
0N/A * Prints this <code>MarshalException</code>, its backtrace and
0N/A * the cause's backtrace to the specified print writer.
0N/A *
0N/A * @param s <code>PrintWriter</code> to use for output
0N/A */
0N/A public void printStackTrace(PrintWriter s) {
0N/A super.printStackTrace(s);
0N/A //XXX print backtrace of cause
0N/A }
0N/A}