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