Path: blob/master/src/java.base/share/classes/java/text/ParseException.java
41152 views
/*1* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26* (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved27* (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved28*29* The original version of this source code and documentation is copyrighted30* and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These31* materials are provided under terms of a License Agreement between Taligent32* and Sun. This technology is protected by multiple US and International33* patents. This notice and attribution to Taligent may not be removed.34* Taligent is a registered trademark of Taligent, Inc.35*36*/3738package java.text;3940/**41* Signals that an error has been reached unexpectedly42* while parsing.43* @see java.lang.Exception44* @see java.text.Format45* @see java.text.FieldPosition46* @author Mark Davis47* @since 1.148*/49public class ParseException extends Exception {5051@java.io.Serial52private static final long serialVersionUID = 2703218443322787634L;5354/**55* Constructs a ParseException with the specified detail message and56* offset.57* A detail message is a String that describes this particular exception.58*59* @param s the detail message60* @param errorOffset the position where the error is found while parsing.61*/62public ParseException(String s, int errorOffset) {63super(s);64this.errorOffset = errorOffset;65}6667/**68* Returns the position where the error was found.69*70* @return the position where the error was found71*/72public int getErrorOffset () {73return errorOffset;74}7576//============ privates ============77/**78* The zero-based character offset into the string being parsed at which79* the error was found during parsing.80* @serial81*/82private int errorOffset;83}848586