1 28 package net.sf.jasperreports.engine.fill; 29 30 import java.io.PrintStream ; 31 import java.io.PrintWriter ; 32 33 import net.sf.jasperreports.engine.JRException; 34 import net.sf.jasperreports.engine.JRExpression; 35 36 37 41 public class JRExpressionEvalException extends JRException 42 { 43 44 45 48 private JRExpression expression = null; 49 private Throwable nestedThrowable = null; 50 51 52 55 public JRExpressionEvalException(JRExpression expr, Throwable e) 56 { 57 super( 58 "Error evaluating expression : " 59 + "\n\tSource text : " + expr.getText() 60 ); 61 62 expression = expr; 63 nestedThrowable = e; 64 } 65 66 67 70 public Throwable getCause() 71 { 72 return this.nestedThrowable; 73 } 74 75 76 79 public JRExpression getExpression() 80 { 81 return this.expression; 82 } 83 84 85 88 public void printStackTrace() 89 { 90 if (nestedThrowable != null) 91 { 92 nestedThrowable.printStackTrace(); 93 System.err.println("\nNESTED BY :"); 94 } 95 96 super.printStackTrace(); 97 } 98 99 100 103 public void printStackTrace(PrintStream s) 104 { 105 if (nestedThrowable != null) 106 { 107 nestedThrowable.printStackTrace(s); 108 s.println("\nNESTED BY :"); 109 } 110 111 super.printStackTrace(s); 112 } 113 114 115 118 public void printStackTrace(PrintWriter s) 119 { 120 if (nestedThrowable != null) 121 { 122 nestedThrowable.printStackTrace(s); 123 s.println("\nNESTED BY :"); 124 } 125 126 super.printStackTrace(s); 127 } 128 129 130 } 131 | Popular Tags |