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