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>DOMErrorHandler</code> is a callback interface that the DOM
  15. * implementation can call when reporting errors that happens while
  16. * processing XML data, or when doing some other processing (e.g. validating
  17. * a document). A <code>DOMErrorHandler</code> object can be attached to a
  18. * <code>Document</code> using the "error-handler" on the
  19. * <code>DOMConfiguration</code> interface. If more than one error needs to
  20. * be reported during an operation, the sequence and numbers of the errors
  21. * passed to the error handler are implementation dependent.
  22. * <p> The application that is using the DOM implementation is expected to
  23. * implement this interface.
  24. * <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>.
  25. * @since DOM Level 3
  26. */
  27. public interface DOMErrorHandler {
  28. /**
  29. * This method is called on the error handler when an error occurs.
  30. * <br> If an exception is thrown from this method, it is considered to be
  31. * equivalent of returning <code>true</code>.
  32. * @param error The error object that describes the error. This object
  33. * may be reused by the DOM implementation across multiple calls to
  34. * the <code>handleError</code> method.
  35. * @return If the <code>handleError</code> method returns
  36. * <code>false</code>, the DOM implementation should stop the current
  37. * processing when possible. If the method returns <code>true</code>,
  38. * the processing may continue depending on
  39. * <code>DOMError.severity</code>.
  40. */
  41. public boolean handleError(DOMError error);
  42. }