1. /*
  2. * @(#)ParseException.java 1.13 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * @(#)ParseException.java 1.13 01/11/29
  9. *
  10. * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
  11. * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
  12. *
  13. * Portions copyright (c) 1996-1998 Sun Microsystems, Inc.
  14. * All Rights Reserved.
  15. *
  16. * The original version of this source code and documentation is copyrighted
  17. * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
  18. * materials are provided under terms of a License Agreement between Taligent
  19. * and Sun. This technology is protected by multiple US and International
  20. * patents. This notice and attribution to Taligent may not be removed.
  21. * Taligent is a registered trademark of Taligent, Inc.
  22. *
  23. * Permission to use, copy, modify, and distribute this software
  24. * and its documentation for NON-COMMERCIAL purposes and without
  25. * fee is hereby granted provided that this copyright notice
  26. * appears in all copies. Please refer to the file "copyright.html"
  27. * for further important copyright and licensing information.
  28. *
  29. * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  30. * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  31. * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  32. * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  33. * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  34. * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  35. *
  36. */
  37. package java.text;
  38. /**
  39. * Signals that an error has been reached unexpectedly
  40. * while parsing.
  41. * @see java.lang.Exception
  42. * @see java.text.Format
  43. * @see java.text.FieldPosition
  44. * @version 1.13, 11/29/01
  45. * @author Mark Davis
  46. */
  47. public
  48. class ParseException extends Exception {
  49. /**
  50. * Constructs a ParseException with the specified detail message and
  51. * offset.
  52. * A detail message is a String that describes this particular exception.
  53. * @param s the detail message
  54. * @param errorOffset the position where the error is found while parsing.
  55. */
  56. public ParseException(String s, int errorOffset) {
  57. super(s);
  58. this.errorOffset = errorOffset;
  59. }
  60. /**
  61. * Returns the position where the error was found.
  62. */
  63. public int getErrorOffset () {
  64. return errorOffset;
  65. }
  66. //============ privates ============
  67. /**
  68. * The zero-based character offset into the string being parsed at which
  69. * the error was found during parsing.
  70. * @serial
  71. */
  72. private int errorOffset;
  73. }