01: /*
02: * Copyright 2004-2006 Fouad HAMDI.
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: package org.csvbeans.parsers;
17:
18: /**
19: * Parsing exception. It allows to retrieve the line position where the error
20: * occured and the incriminated CSV line.
21: *
22: * @author Fouad Hamdi
23: * @since 0.5
24: */
25: public class ParsingException extends CSVLineException {
26: private final static long serialVersionUID = 1L;
27:
28: /**
29: * The line number where the exception occured.
30: */
31: private int lineNumber;
32:
33: /**
34: * Constructor.
35: *
36: * @param msg
37: * message that describes the exception.
38: */
39: public ParsingException(String errorCode, String msg, String line,
40: int lineNumber) {
41: super (errorCode, msg, line);
42: this .lineNumber = lineNumber;
43: }
44:
45: /**
46: * Constructor.
47: *
48: * @param msg
49: * message that describes the exception.
50: */
51: public ParsingException(String errorCode, String msg, String line,
52: int lineNumber, Throwable t) {
53: super (errorCode, msg, line, t);
54: this .lineNumber = lineNumber;
55: }
56:
57: /**
58: * @return Returns the lineNumber.
59: */
60: public int getLineNumber() {
61: return lineNumber;
62: }
63: }
|