DOMErrorHandler.java revision 628:2bfaf29cc90b
138494Sobrien/*
2174294Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
338494Sobrien *
438494Sobrien * This code is free software; you can redistribute it and/or modify it
538494Sobrien * under the terms of the GNU General Public License version 2 only, as
638494Sobrien * published by the Free Software Foundation.  Oracle designates this
738494Sobrien * particular file as subject to the "Classpath" exception as provided
838494Sobrien * by Oracle in the LICENSE file that accompanied this code.
938494Sobrien *
1038494Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT
1138494Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1238494Sobrien * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1338494Sobrien * version 2 for more details (a copy is included in the LICENSE file that
1438494Sobrien * accompanied this code).
1538494Sobrien *
1638494Sobrien * You should have received a copy of the GNU General Public License version
1738494Sobrien * 2 along with this work; if not, write to the Free Software Foundation,
1838494Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1938494Sobrien *
2042629Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2138494Sobrien * or visit www.oracle.com if you need additional information or have any
2238494Sobrien * questions.
2338494Sobrien */
2438494Sobrien
2538494Sobrien/*
2638494Sobrien * This file is available under and governed by the GNU General Public
2738494Sobrien * License version 2 only, as published by the Free Software Foundation.
2838494Sobrien * However, the following notice accompanied the original version of this
2938494Sobrien * file and, per its terms, should not be removed:
3038494Sobrien *
3138494Sobrien * Copyright (c) 2004 World Wide Web Consortium,
3238494Sobrien *
3338494Sobrien * (Massachusetts Institute of Technology, European Research Consortium for
3438494Sobrien * Informatics and Mathematics, Keio University). All Rights Reserved. This
3538494Sobrien * work is distributed under the W3C(r) Software License [1] in the hope that
3638494Sobrien * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
3738494Sobrien * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3838494Sobrien *
3938494Sobrien * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
40174294Sobrien */
4138494Sobrien
4238494Sobrienpackage org.w3c.dom;
4338494Sobrien
4438494Sobrien/**
4538494Sobrien *  <code>DOMErrorHandler</code> is a callback interface that the DOM
4638494Sobrien * implementation can call when reporting errors that happens while
4738494Sobrien * processing XML data, or when doing some other processing (e.g. validating
4838494Sobrien * a document). A <code>DOMErrorHandler</code> object can be attached to a
4938494Sobrien * <code>Document</code> using the "error-handler" on the
5038494Sobrien * <code>DOMConfiguration</code> interface. If more than one error needs to
5138494Sobrien * be reported during an operation, the sequence and numbers of the errors
52131702Smbr * passed to the error handler are implementation dependent.
5338494Sobrien * <p> The application that is using the DOM implementation is expected to
5438494Sobrien * implement this interface.
5538494Sobrien * <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>.
5638494Sobrien * @since 1.5, DOM Level 3
5738494Sobrien */
5838494Sobrienpublic interface DOMErrorHandler {
5938494Sobrien    /**
6038494Sobrien     * This method is called on the error handler when an error occurs.
6138494Sobrien     * <br> If an exception is thrown from this method, it is considered to be
6238494Sobrien     * equivalent of returning <code>true</code>.
6338494Sobrien     * @param error  The error object that describes the error. This object
64131702Smbr     *   may be reused by the DOM implementation across multiple calls to
6538494Sobrien     *   the <code>handleError</code> method.
66131702Smbr     * @return  If the <code>handleError</code> method returns
6738494Sobrien     *   <code>false</code>, the DOM implementation should stop the current
6838494Sobrien     *   processing when possible. If the method returns <code>true</code>,
69131702Smbr     *   the processing may continue depending on
7038494Sobrien     *   <code>DOMError.severity</code>.
7138494Sobrien     */
7238494Sobrien    public boolean handleError(DOMError error);
7338494Sobrien
7438494Sobrien}
7538494Sobrien