KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > text > ParseException


1 /*
2  * @(#)ParseException.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 /*
9  * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
10  * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
11  *
12  * The original version of this source code and documentation is copyrighted
13  * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
14  * materials are provided under terms of a License Agreement between Taligent
15  * and Sun. This technology is protected by multiple US and International
16  * patents. This notice and attribution to Taligent may not be removed.
17  * Taligent is a registered trademark of Taligent, Inc.
18  *
19  */

20
21 package java.text;
22
23 /**
24  * Signals that an error has been reached unexpectedly
25  * while parsing.
26  * @see java.lang.Exception
27  * @see java.text.Format
28  * @see java.text.FieldPosition
29  * @version 1.16, 12/19/03
30  * @author Mark Davis
31  */

32 public
33 class ParseException extends Exception JavaDoc {
34
35     /**
36      * Constructs a ParseException with the specified detail message and
37      * offset.
38      * A detail message is a String that describes this particular exception.
39      * @param s the detail message
40      * @param errorOffset the position where the error is found while parsing.
41      */

42     public ParseException(String JavaDoc s, int errorOffset) {
43         super(s);
44         this.errorOffset = errorOffset;
45     }
46
47     /**
48      * Returns the position where the error was found.
49      */

50     public int getErrorOffset () {
51         return errorOffset;
52     }
53
54     //============ privates ============
55
/**
56      * The zero-based character offset into the string being parsed at which
57      * the error was found during parsing.
58      * @serial
59      */

60     private int errorOffset;
61 }
62
Popular Tags