1 3 9 10 package javax.xml.xpath; 11 12 import java.io.PrintWriter ; 13 14 22 public class XPathException extends Exception { 23 24 private final Throwable cause; 25 26 29 private static final long serialVersionUID = -1837080260374986980L; 30 31 40 public XPathException(String message) { 41 super(message); 42 if ( message == null ) { 43 throw new NullPointerException ( "message can't be null"); 44 } 45 this.cause = null; 46 } 47 48 57 public XPathException(Throwable cause) { 58 super(); 59 this.cause = cause; 60 if ( cause == null ) { 61 throw new NullPointerException ( "cause can't be null"); 62 } 63 } 64 65 public Throwable getCause() { 66 return cause; 67 } 68 69 public void printStackTrace( java.io.PrintStream s ) { 70 if( getCause() != null ) { 71 getCause().printStackTrace(s); 72 s.println("--------------- linked to ------------------"); 73 } 74 75 super.printStackTrace(s); 76 } 77 78 public void printStackTrace() { 79 printStackTrace(System.err); 80 } 81 82 public void printStackTrace(PrintWriter s) { 83 if( getCause() != null ) { 84 getCause().printStackTrace(s); 85 s.println("--------------- linked to ------------------"); 86 } 87 88 super.printStackTrace(s); 89 } 90 } 91 | Popular Tags |