1 40 package org.jfree.xml; 41 42 import java.io.PrintStream ; 43 import java.io.PrintWriter ; 44 45 import org.xml.sax.Locator ; 46 47 53 public class ElementDefinitionException extends ParseException { 54 55 56 private Exception parent; 57 58 64 public ElementDefinitionException(final String message) { 65 super(message); 66 } 67 68 74 public ElementDefinitionException(final Exception e) { 75 this(e, e.getMessage()); 76 } 77 78 85 public ElementDefinitionException(final Exception e, final String message) { 86 this(message); 87 this.parent = e; 88 } 89 90 97 public ElementDefinitionException(final Exception e, final Locator locator) { 98 super(e, locator); 99 this.parent = e; 100 } 101 102 108 public ElementDefinitionException(final String message, final Locator locator) { 109 super(message, locator); 110 } 111 112 120 public ElementDefinitionException(final String s, final Exception e, final Locator locator) { 121 super(s, e, locator); 122 this.parent = e; 123 } 124 125 130 public Exception getParentException() { 131 return this.parent; 132 } 133 134 140 public void printStackTrace(final PrintStream s) { 141 super.printStackTrace(s); 142 if (this.parent != null) { 143 s.print("ParentException:"); 144 this.parent.printStackTrace(s); 145 } 146 else { 147 s.println("ParentException: <null>"); 148 } 149 } 150 151 157 public void printStackTrace(final PrintWriter s) { 158 super.printStackTrace(s); 159 if (this.parent != null) { 160 s.print("ParentException:"); 161 this.parent.printStackTrace(s); 162 } 163 else { 164 s.println("ParentException: <null>"); 165 } 166 } 167 168 } 169 | Popular Tags |