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