001    /*
002     * Copyright (c) 2004 World Wide Web Consortium,
003     *
004     * (Massachusetts Institute of Technology, European Research Consortium for
005     * Informatics and Mathematics, Keio University). All Rights Reserved. This
006     * work is distributed under the W3C(r) Software License [1] in the hope that
007     * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
008     * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
009     *
010     * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
011     */
012    
013    package org.w3c.dom;
014    
015    /**
016     *  <code>DOMErrorHandler</code> is a callback interface that the DOM
017     * implementation can call when reporting errors that happens while
018     * processing XML data, or when doing some other processing (e.g. validating
019     * a document). A <code>DOMErrorHandler</code> object can be attached to a
020     * <code>Document</code> using the "error-handler" on the
021     * <code>DOMConfiguration</code> interface. If more than one error needs to
022     * be reported during an operation, the sequence and numbers of the errors
023     * passed to the error handler are implementation dependent.
024     * <p> The application that is using the DOM implementation is expected to
025     * implement this interface.
026     * <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>.
027     * @since DOM Level 3
028     */
029    public interface DOMErrorHandler {
030        /**
031         * This method is called on the error handler when an error occurs.
032         * <br> If an exception is thrown from this method, it is considered to be
033         * equivalent of returning <code>true</code>.
034         * @param error  The error object that describes the error. This object
035         *   may be reused by the DOM implementation across multiple calls to
036         *   the <code>handleError</code> method.
037         * @return  If the <code>handleError</code> method returns
038         *   <code>false</code>, the DOM implementation should stop the current
039         *   processing when possible. If the method returns <code>true</code>,
040         *   the processing may continue depending on
041         *   <code>DOMError.severity</code>.
042         */
043        public boolean handleError(DOMError error);
044    
045    }