01: /*
02: * $Id: IllegalStreamStateException.java,v 1.1 2004/07/12 17:27:21 cniles Exp $
03: */
04: package javanet.staxutils.error;
05:
06: import javax.xml.stream.Location;
07:
08: /**
09: * {@link IllegalStateException} that includes a StAX {@link Location} identifying
10: * the point where the error occured.
11: *
12: * @author Christian Niles
13: * @version $Revision: 1.1 $
14: */
15: public class IllegalStreamStateException extends IllegalStateException {
16:
17: /** The location in the stream where the error occured. */
18: private Location location;
19:
20: public IllegalStreamStateException() {
21:
22: }
23:
24: public IllegalStreamStateException(Location location) {
25:
26: this .location = location;
27:
28: }
29:
30: public IllegalStreamStateException(String s) {
31:
32: super (s);
33:
34: }
35:
36: public IllegalStreamStateException(String s, Location location) {
37:
38: super (s);
39: this .location = location;
40:
41: }
42:
43: /**
44: * Returns the {@link Location} where the error occured.
45: *
46: * @return The {@link Location} where the error occured.
47: */
48: public Location getLocation() {
49:
50: return this .location;
51:
52: }
53:
54: /**
55: * Sets the {@link Location} where the error occured.
56: *
57: * @param location The {@link Location} where the error occured.
58: */
59: public void setLocation(Location location) {
60:
61: this.location = location;
62:
63: }
64:
65: }
|