All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.gr.xml.relax.dom.DOMVisitorException Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package jp.gr.xml.relax.dom;

import java.io.PrintStream;
import java.io.PrintWriter;

public class DOMVisitorException extends RuntimeException {

    public DOMVisitorException(String s) {
        super(s);
        cause_ = null;
    }

    public DOMVisitorException(Exception exception) {
        super(exception.getMessage());
        cause_ = null;
        cause_ = exception;
    }

    public DOMVisitorException(String s, Exception exception) {
        super(s);
        cause_ = null;
        cause_ = exception;
    }

    public Exception getException() {
        if(cause_ != null)
            return cause_;
        else
            return this;
    }

    public Exception getCauseException() {
        return cause_;
    }

    public void printStackTrace() {
        printStackTrace(new PrintWriter(System.err, true));
    }

    public void printStackTrace(PrintStream printstream) {
        printStackTrace(new PrintWriter(printstream));
    }

    public void printStackTrace(PrintWriter printwriter) {
        if(printwriter == null)
            printwriter = new PrintWriter(System.err, true);
        super.printStackTrace(printwriter);
        if(cause_ != null) {
            printwriter.println();
            printwriter.println("StackTrace of Original Exception:");
            cause_.printStackTrace(printwriter);
        }
    }

    private Exception cause_;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy