1 28 29 package com.caucho.xsl; 30 31 import com.caucho.util.LineCompileException; 32 33 import javax.xml.transform.TransformerConfigurationException ; 34 import java.io.PrintStream ; 35 import java.io.PrintWriter ; 36 37 public class XslParseException extends TransformerConfigurationException 38 implements LineCompileException { 39 protected Throwable e; 40 41 public XslParseException() 42 { 43 } 44 45 public XslParseException(String msg) 46 { 47 super(msg); 48 } 49 50 public XslParseException(Throwable e) 51 { 52 super(e); 53 54 this.e = e; 55 } 56 57 public XslParseException(String msg, Throwable e) 58 { 59 super(msg, e); 60 61 this.e = e; 62 } 63 64 67 public static XslParseException create(String msg) 68 { 69 return new XslParseException(msg); 70 } 71 72 public Throwable getCause() 73 { 74 return e; 75 } 76 77 public String getMessage() 78 { 79 if (e != null && e.getMessage() != null) 80 return e.getMessage(); 81 else if (e != null) 82 return e.toString(); 83 else 84 return super.getMessage(); 85 } 86 87 public void printStackTrace() 88 { 89 if (e != null) 90 e.printStackTrace(); 91 else 92 super.printStackTrace(); 93 } 94 95 public void printStackTrace(PrintStream os) 96 { 97 if (e != null) 98 e.printStackTrace(os); 99 else 100 super.printStackTrace(os); 101 } 102 103 public void printStackTrace(PrintWriter pw) 104 { 105 if (e != null) 106 e.printStackTrace(pw); 107 else 108 super.printStackTrace(pw); 109 } 110 111 public String toString() 112 { 113 if (e != null) 114 return e.toString(); 115 else 116 return super.toString(); 117 } 118 } 119 | Popular Tags |