1 28 29 package org.jibx.runtime; 30 31 import java.io.PrintStream ; 32 import java.io.PrintWriter ; 33 34 41 42 public class JiBXException extends Exception 43 { 44 45 private Throwable m_rootCause; 46 47 52 public JiBXException(String msg) { 53 super(msg); 54 } 55 56 62 public JiBXException(String msg, Throwable root) { 63 super(msg); 64 m_rootCause = root; 65 } 66 67 72 public Throwable getRootCause() { 73 return m_rootCause; 74 } 75 76 80 81 public void printStackTrace() { 82 super.printStackTrace(); 83 } 84 85 91 92 public void printStackTrace(PrintStream s) { 93 if (m_rootCause == null) { 94 super.printStackTrace(s); 95 } else { 96 s.println(getMessage()); 97 m_rootCause.printStackTrace(s); 98 s.println(); 99 } 100 } 101 102 108 109 public void printStackTrace(PrintWriter s) { 110 if (m_rootCause == null) { 111 super.printStackTrace(s); 112 } else { 113 s.println(getMessage()); 114 m_rootCause.printStackTrace(s); 115 s.println(); 116 } 117 } 118 } | Popular Tags |