1. /*
  2. * @(#)ParseException.java 1.15 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
  9. * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
  10. *
  11. * The original version of this source code and documentation is copyrighted
  12. * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
  13. * materials are provided under terms of a License Agreement between Taligent
  14. * and Sun. This technology is protected by multiple US and International
  15. * patents. This notice and attribution to Taligent may not be removed.
  16. * Taligent is a registered trademark of Taligent, Inc.
  17. *
  18. */
  19. package java.text;
  20. /**
  21. * Signals that an error has been reached unexpectedly
  22. * while parsing.
  23. * @see java.lang.Exception
  24. * @see java.text.Format
  25. * @see java.text.FieldPosition
  26. * @version 1.15, 01/23/03
  27. * @author Mark Davis
  28. */
  29. public
  30. class ParseException extends Exception {
  31. /**
  32. * Constructs a ParseException with the specified detail message and
  33. * offset.
  34. * A detail message is a String that describes this particular exception.
  35. * @param s the detail message
  36. * @param errorOffset the position where the error is found while parsing.
  37. */
  38. public ParseException(String s, int errorOffset) {
  39. super(s);
  40. this.errorOffset = errorOffset;
  41. }
  42. /**
  43. * Returns the position where the error was found.
  44. */
  45. public int getErrorOffset () {
  46. return errorOffset;
  47. }
  48. //============ privates ============
  49. /**
  50. * The zero-based character offset into the string being parsed at which
  51. * the error was found during parsing.
  52. * @serial
  53. */
  54. private int errorOffset;
  55. }