1. /*
  2. * Copyright (c) 2004 World Wide Web Consortium,
  3. *
  4. * (Massachusetts Institute of Technology, European Research Consortium for
  5. * Informatics and Mathematics, Keio University). All Rights Reserved. This
  6. * work is distributed under the W3C(r) Software License [1] in the hope that
  7. * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. *
  10. * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  11. */
  12. package org.w3c.dom;
  13. /**
  14. * <code>DOMError</code> is an interface that describes an error.
  15. * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
  16. * @since DOM Level 3
  17. */
  18. public interface DOMError {
  19. // ErrorSeverity
  20. /**
  21. * The severity of the error described by the <code>DOMError</code> is
  22. * warning. A <code>SEVERITY_WARNING</code> will not cause the
  23. * processing to stop, unless <code>DOMErrorHandler.handleError()</code>
  24. * returns <code>false</code>.
  25. */
  26. public static final short SEVERITY_WARNING = 1;
  27. /**
  28. * The severity of the error described by the <code>DOMError</code> is
  29. * error. A <code>SEVERITY_ERROR</code> may not cause the processing to
  30. * stop if the error can be recovered, unless
  31. * <code>DOMErrorHandler.handleError()</code> returns <code>false</code>.
  32. */
  33. public static final short SEVERITY_ERROR = 2;
  34. /**
  35. * The severity of the error described by the <code>DOMError</code> is
  36. * fatal error. A <code>SEVERITY_FATAL_ERROR</code> will cause the
  37. * normal processing to stop. The return value of
  38. * <code>DOMErrorHandler.handleError()</code> is ignored unless the
  39. * implementation chooses to continue, in which case the behavior
  40. * becomes undefined.
  41. */
  42. public static final short SEVERITY_FATAL_ERROR = 3;
  43. /**
  44. * The severity of the error, either <code>SEVERITY_WARNING</code>,
  45. * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
  46. */
  47. public short getSeverity();
  48. /**
  49. * An implementation specific string describing the error that occurred.
  50. */
  51. public String getMessage();
  52. /**
  53. * A <code>DOMString</code> indicating which related data is expected in
  54. * <code>relatedData</code>. Users should refer to the specification of
  55. * the error in order to find its <code>DOMString</code> type and
  56. * <code>relatedData</code> definitions if any.
  57. * <p ><b>Note:</b> As an example,
  58. * <code>Document.normalizeDocument()</code> does generate warnings when
  59. * the "split-cdata-sections" parameter is in use. Therefore, the method
  60. * generates a <code>SEVERITY_WARNING</code> with <code>type</code>
  61. * <code>"cdata-sections-splitted"</code> and the first
  62. * <code>CDATASection</code> node in document order resulting from the
  63. * split is returned by the <code>relatedData</code> attribute.
  64. */
  65. public String getType();
  66. /**
  67. * The related platform dependent exception if any.
  68. */
  69. public Object getRelatedException();
  70. /**
  71. * The related <code>DOMError.type</code> dependent data if any.
  72. */
  73. public Object getRelatedData();
  74. /**
  75. * The location of the error.
  76. */
  77. public DOMLocator getLocation();
  78. }