01: /*
02: *
03: * @(#)ParseException.java 1.20 06/10/10
04: *
05: * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights
06: * Reserved. Use is subject to license terms.
07: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
08: *
09: * This program is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU General Public License version
11: * 2 only, as published by the Free Software Foundation.
12: *
13: * This program is distributed in the hope that it will be useful, but
14: * WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * General Public License version 2 for more details (a copy is
17: * included at /legal/license.txt).
18: *
19: * You should have received a copy of the GNU General Public License
20: * version 2 along with this work; if not, write to the Free Software
21: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22: * 02110-1301 USA
23: *
24: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
25: * Clara, CA 95054 or visit www.sun.com if you need additional
26: * information or have any questions.
27: */
28:
29: /*
30: * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
31: * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
32: *
33: * The original version of this source code and documentation is copyrighted
34: * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
35: * materials are provided under terms of a License Agreement between Taligent
36: * and Sun. This technology is protected by multiple US and International
37: * patents. This notice and attribution to Taligent may not be removed.
38: * Taligent is a registered trademark of Taligent, Inc.
39: *
40: */
41:
42: package java.text;
43:
44: /**
45: * Signals that an error has been reached unexpectedly
46: * while parsing.
47: * @see java.lang.Exception
48: * @see java.text.Format
49: * @see java.text.FieldPosition
50: * @version 1.13, 01/19/00
51: * @author Mark Davis
52: */
53: public class ParseException extends Exception {
54:
55: /**
56: * Constructs a ParseException with the specified detail message and
57: * offset.
58: * A detail message is a String that describes this particular exception.
59: * @param s the detail message
60: * @param errorOffset the position where the error is found while parsing.
61: */
62: public ParseException(String s, int errorOffset) {
63: super (s);
64: this .errorOffset = errorOffset;
65: }
66:
67: /**
68: * Returns the position where the error was found.
69: */
70: public int getErrorOffset() {
71: return errorOffset;
72: }
73:
74: //============ privates ============
75: /**
76: * The zero-based character offset into the string being parsed at which
77: * the error was found during parsing.
78: * @serial
79: */
80: private int errorOffset;
81: }
|