01: /*
02: * SdpException.java
03: *
04: * Created on December 18, 2001, 11:08 AM
05: */
06:
07: package javax.sdp;
08:
09: /** The SdpParseException encapsulates the information thrown when an error occurs
10: * during SDP parsing.
11: * @author deruelle
12: * @version 1.0
13: */
14: public class SdpParseException extends SdpException {
15:
16: private int lineNumber;
17: private int charOffset;
18:
19: /** Constructs a new SdpParseException when the parser needs to throw an exception
20: * indicating a parsing failure.
21: * @param lineNumber SDP line number that caused the exception.
22: * @param charOffset offset of the characeter that caused the exception.
23: * @param message a String containing the text of the exception message
24: * @param rootCause the Throwable exception that interfered with the Codelet's
25: * normal operation, making this Codelet exception necessary.
26: */
27: public SdpParseException(int lineNumber, int charOffset,
28: String message, Throwable rootCause) {
29: super (message, rootCause);
30: this .lineNumber = lineNumber;
31: this .charOffset = charOffset;
32: }
33:
34: /** Constructs a new SdpParseException when the parser needs to throw an exception
35: * indicating a parsing failure.
36: * @param lineNumber SDP line number that caused the exception.
37: * @param charOffset offset of the characeter that caused the exception.
38: * @param message a String containing the text of the exception message
39: */
40: public SdpParseException(int lineNumber, int charOffset,
41: String message) {
42: super (message);
43: this .lineNumber = lineNumber;
44: this .charOffset = charOffset;
45: }
46:
47: /** Returns the line number where the error occured
48: * @return the line number where the error occured
49: */
50: public int getLineNumber() {
51: return lineNumber;
52: }
53:
54: /** Returns the char offset where the error occured.
55: * @return the char offset where the error occured.
56: */
57: public int getCharOffset() {
58: return charOffset;
59: }
60:
61: /** Returns the message stored when the exception was created.
62: * @return the message stored when the exception was created.
63: */
64: public String getMessage() {
65: return super.getMessage();
66: }
67:
68: }
|