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