01: /*
02: * Copyright 2004 Sun Microsystems, Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: *
16: */
17: package com.sun.syndication.io;
18:
19: import org.jdom.input.JDOMParseException;
20:
21: /**
22: * Exception thrown by WireFeedInput instance if it can not parse a feed.
23: * <p>
24: * @author Elaine Chien
25: *
26: */
27: public class ParsingFeedException extends FeedException {
28:
29: /**
30: * Creates a FeedException with a message.
31: * <p>
32: * @param msg exception message.
33: *
34: */
35: public ParsingFeedException(String msg) {
36: super (msg);
37: }
38:
39: /**
40: * Creates a FeedException with a message and a root cause exception.
41: * <p>
42: * @param msg exception message.
43: * @param rootCause root cause exception.
44: *
45: */
46: public ParsingFeedException(String msg, Throwable rootCause) {
47: super (msg, rootCause);
48: }
49:
50: /**
51: * Returns the line number of the end of the text where the
52: * parse error occurred.
53: * <p>
54: * The first line in the document is line 1.</p>
55: *
56: * @return an integer representing the line number, or -1
57: * if the information is not available.
58: */
59: public int getLineNumber() {
60: return (getCause() instanceof JDOMParseException) ? ((JDOMParseException) getCause())
61: .getLineNumber()
62: : -1;
63: }
64:
65: /**
66: * Returns the column number of the end of the text where the
67: * parse error occurred.
68: * <p>
69: * The first column in a line is position 1.</p>
70: *
71: * @return an integer representing the column number, or -1
72: * if the information is not available.
73: */
74: public int getColumnNumber() {
75: return (getCause() instanceof JDOMParseException) ? ((JDOMParseException) getCause())
76: .getColumnNumber()
77: : -1;
78: }
79:
80: }
|