1 17 package org.apache.ws.jaxme.generator; 18 19 import java.io.PrintStream ; 20 import java.io.PrintWriter ; 21 22 26 public class SchemaException extends Exception { 27 private Throwable inner; 28 29 public SchemaException(String pMsg) { 30 super(pMsg); 31 } 32 33 public SchemaException(Throwable pInner) { 34 inner = pInner; 35 } 36 37 public SchemaException(String pMsg, Throwable pInner) { 38 this(pMsg); 39 inner = pInner; 40 } 41 42 public Throwable getInner() { 43 return inner; 44 } 45 46 public void printStackTrace() { 47 super.printStackTrace(); 48 if (inner != null) { 49 System.err.println("Root cause:"); 50 inner.printStackTrace(); 51 } 52 } 53 54 public void printStackTrace(PrintStream pStream) { 55 super.printStackTrace(pStream); 56 if (inner != null) { 57 pStream.println("Root cause:"); 58 inner.printStackTrace(pStream); 59 } 60 } 61 62 public void printStackTrace(PrintWriter pWriter) { 63 super.printStackTrace(pWriter); 64 if (inner != null) { 65 pWriter.println("Root cause:"); 66 inner.printStackTrace(pWriter); 67 } 68 } 69 } 70 | Popular Tags |