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;
17:
18: import org.csvbeans.parsers.CSVLineException;
19: import org.csvbeans.specs.Specification;
20:
21: /**
22: * An exception generated when a field is invalid.
23: *
24: * @author Fouad Hamdi
25: * @since 0.5
26: */
27: public class InvalidFieldException extends CSVLineException {
28: private final static long serialVersionUID = 1L;
29:
30: /**
31: * The invalid field.
32: */
33: private Specification field;
34:
35: /**
36: * Constructor.
37: *
38: * @param s
39: * a message describing the error.
40: * @param field
41: * the invalid field.
42: */
43: public InvalidFieldException(String errorCode, String s,
44: String line, Specification field) {
45: super (errorCode, s, line);
46: this .field = field;
47: }
48:
49: /**
50: * Return the invalid field.
51: *
52: * @return the invalid field.
53: */
54: public Specification getField() {
55: return field;
56: }
57: }
|