DOMErrorHandler
Stay organized with collections
Save and categorize content based on your preferences.
DOMErrorHandler
is a callback interface that the DOM
implementation can call when reporting errors that happens while
processing XML data, or when doing some other processing (e.g. validating
a document). A DOMErrorHandler
object can be attached to a
Document
using the "error-handler" on the
DOMConfiguration
interface. If more than one error needs to
be reported during an operation, the sequence and numbers of the errors
passed to the error handler are implementation dependent.
The application that is using the DOM implementation is expected to
implement this interface.
See also the Document Object Model (DOM) Level 3 Core Specification.
Public Methods
public
abstract
boolean
handleError
(DOMError error)
This method is called on the error handler when an error occurs.
If an exception is thrown from this method, it is considered to be
equivalent of returning true
.
Parameters
error |
The error object that describes the error. This object
may be reused by the DOM implementation across multiple calls to
the handleError method. |
Returns
- If the
handleError
method returns
false
, the DOM implementation should stop the current
processing when possible. If the method returns true
,
the processing may continue depending on
DOMError.severity
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eDOMErrorHandler\u003c/code\u003e is a callback interface used by the DOM to report errors during XML processing or validation.\u003c/p\u003e\n"],["\u003cp\u003eApplications using the DOM are expected to implement this interface to handle errors.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ehandleError\u003c/code\u003e method is called when an error occurs, allowing the application to decide whether to halt or continue processing.\u003c/p\u003e\n"],["\u003cp\u003eReturning \u003ccode\u003efalse\u003c/code\u003e from \u003ccode\u003ehandleError\u003c/code\u003e signals the DOM to stop processing, while \u003ccode\u003etrue\u003c/code\u003e may allow it to continue based on the error's severity.\u003c/p\u003e\n"]]],[],null,["public interface **DOMErrorHandler** \n`DOMErrorHandler` is a callback interface that the DOM\nimplementation can call when reporting errors that happens while\nprocessing XML data, or when doing some other processing (e.g. validating\na document). A `DOMErrorHandler` object can be attached to a\n`Document` using the \"error-handler\" on the\n`DOMConfiguration` interface. If more than one error needs to\nbe reported during an operation, the sequence and numbers of the errors\npassed to the error handler are implementation dependent.\n\nThe application that is using the DOM implementation is expected to\nimplement this interface.\n\nSee also the [Document Object Model (DOM) Level 3 Core Specification](http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407). \n\nPublic Method Summary\n\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract boolean | [handleError](../../../../reference/org/w3c/dom/DOMErrorHandler.html#handleError(org.w3c.dom.DOMError))([DOMError](../../../../reference/org/w3c/dom/DOMError.html) error) This method is called on the error handler when an error occurs. |\n\nPublic Methods \n\npublic abstract boolean\n**handleError**\n([DOMError](../../../../reference/org/w3c/dom/DOMError.html) error) \nThis method is called on the error handler when an error occurs.\n\nIf an exception is thrown from this method, it is considered to be\nequivalent of returning `true`. \n\nParameters\n\n| error | The error object that describes the error. This object may be reused by the DOM implementation across multiple calls to the `handleError` method. |\n|-------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n\nReturns\n\n- If the `handleError` method returns `false`, the DOM implementation should stop the current processing when possible. If the method returns `true`, the processing may continue depending on `DOMError.severity`."]]