1. /*
  2. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. /*
  6. * @(#)SourceLocator.java 1.8 03/01/23
  7. */
  8. package javax.xml.transform;
  9. /**
  10. * This interface is primarily for the purposes of reporting where
  11. * an error occurred in the XML source or transformation instructions.
  12. */
  13. public interface SourceLocator {
  14. /**
  15. * Return the public identifier for the current document event.
  16. *
  17. * <p>The return value is the public identifier of the document
  18. * entity or of the external parsed entity in which the markup that
  19. * triggered the event appears.</p>
  20. *
  21. * @return A string containing the public identifier, or
  22. * null if none is available.
  23. * @see #getSystemId
  24. */
  25. public String getPublicId();
  26. /**
  27. * Return the system identifier for the current document event.
  28. *
  29. * <p>The return value is the system identifier of the document
  30. * entity or of the external parsed entity in which the markup that
  31. * triggered the event appears.</p>
  32. *
  33. * <p>If the system identifier is a URL, the parser must resolve it
  34. * fully before passing it to the application.</p>
  35. *
  36. * @return A string containing the system identifier, or null
  37. * if none is available.
  38. * @see #getPublicId
  39. */
  40. public String getSystemId();
  41. /**
  42. * Return the line number where the current document event ends.
  43. *
  44. * <p><strong>Warning:</strong> The return value from the method
  45. * is intended only as an approximation for the sake of error
  46. * reporting; it is not intended to provide sufficient information
  47. * to edit the character content of the original XML document.</p>
  48. *
  49. * <p>The return value is an approximation of the line number
  50. * in the document entity or external parsed entity where the
  51. * markup that triggered the event appears.</p>
  52. *
  53. * @return The line number, or -1 if none is available.
  54. * @see #getColumnNumber
  55. */
  56. public int getLineNumber();
  57. /**
  58. * Return the character position where the current document event ends.
  59. *
  60. * <p><strong>Warning:</strong> The return value from the method
  61. * is intended only as an approximation for the sake of error
  62. * reporting; it is not intended to provide sufficient information
  63. * to edit the character content of the original XML document.</p>
  64. *
  65. * <p>The return value is an approximation of the column number
  66. * in the document entity or external parsed entity where the
  67. * markup that triggered the event appears.</p>
  68. *
  69. * @return The column number, or -1 if none is available.
  70. * @see #getLineNumber
  71. */
  72. public int getColumnNumber();
  73. }