1 9 package javolution.xml.stream; 10 11 17 public class XMLStreamException extends Exception { 18 19 22 private Throwable _nested; 23 24 27 private Location _location; 28 29 32 public XMLStreamException() { 33 super(); 34 } 35 36 41 public XMLStreamException(String msg) { 42 super(msg); 43 } 44 45 50 public XMLStreamException(Throwable nested) { 51 _nested = nested; 52 } 53 54 60 public XMLStreamException(String msg, Throwable nested) { 61 super(msg); 62 _nested = nested; 63 } 64 65 73 public XMLStreamException(String msg, Location location, Throwable nested) { 74 super(msg); 75 _nested = nested; 76 _location = location; 77 } 78 79 86 public XMLStreamException(String msg, Location location) { 87 super(msg); 88 _location = location; 89 } 90 91 96 public Throwable getNestedException() { 97 return _nested; 98 } 99 100 106 public Location getLocation() { 107 return _location; 108 } 109 110 115 public String toString() { 116 String msg = super.toString(); 117 if (_location != null) { 118 msg += " (at line " + _location.getLineNumber() + ", column " 119 + _location.getColumnNumber() + ")"; 120 } 121 if (_nested != null) { 122 msg += " caused by " + _nested.toString(); 123 } 124 return msg; 125 } 126 127 private static final long serialVersionUID = 1L; 128 } 129 | Popular Tags |