1 23 24 package org.objectweb.fractal.adl; 25 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 32 33 public class ParserException extends Exception { 34 35 38 39 private Exception exception; 40 41 47 48 public ParserException (final String msg, final Exception e) { 49 super(msg); 50 this.exception = e; 51 } 52 53 56 57 public void printStackTrace () { 58 if (exception != null) { 59 System.err.println(this); 60 exception.printStackTrace(); 61 } else { 62 super.printStackTrace(); 63 } 64 } 65 66 71 72 public void printStackTrace (final PrintStream s) { 73 if (exception != null) { 74 s.println(this); 75 exception.printStackTrace(s); 76 } else { 77 super.printStackTrace(s); 78 } 79 } 80 81 86 87 public void printStackTrace (final PrintWriter s) { 88 if (exception != null) { 89 s.write(this + "\n"); 90 exception.printStackTrace(s); 91 } else { 92 super.printStackTrace(s); 93 } 94 } 95 } 96 | Popular Tags |