2 * Copyright (c) 2004 World Wide Web Consortium,
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.
10 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
16 * <code>DOMError</code> is an interface that describes an error.
17 * <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>.
20 public interface DOMError {
23 * The severity of the error described by the <code>DOMError</code> is
24 * warning. A <code>SEVERITY_WARNING</code> will not cause the
25 * processing to stop, unless <code>DOMErrorHandler.handleError()</code>
26 * returns <code>false</code>.
28 public static final short SEVERITY_WARNING = 1;
30 * The severity of the error described by the <code>DOMError</code> is
31 * error. A <code>SEVERITY_ERROR</code> may not cause the processing to
32 * stop if the error can be recovered, unless
33 * <code>DOMErrorHandler.handleError()</code> returns <code>false</code>.
35 public static final short SEVERITY_ERROR = 2;
37 * The severity of the error described by the <code>DOMError</code> is
38 * fatal error. A <code>SEVERITY_FATAL_ERROR</code> will cause the
39 * normal processing to stop. The return value of
40 * <code>DOMErrorHandler.handleError()</code> is ignored unless the
41 * implementation chooses to continue, in which case the behavior
44 public static final short SEVERITY_FATAL_ERROR = 3;
47 * The severity of the error, either <code>SEVERITY_WARNING</code>,
48 * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
50 public short getSeverity();
53 * An implementation specific string describing the error that occurred.
55 public String getMessage();
58 * A <code>DOMString</code> indicating which related data is expected in
59 * <code>relatedData</code>. Users should refer to the specification of
60 * the error in order to find its <code>DOMString</code> type and
61 * <code>relatedData</code> definitions if any.
62 * <p ><b>Note:</b> As an example,
63 * <code>Document.normalizeDocument()</code> does generate warnings when
64 * the "split-cdata-sections" parameter is in use. Therefore, the method
65 * generates a <code>SEVERITY_WARNING</code> with <code>type</code>
66 * <code>"cdata-sections-splitted"</code> and the first
67 * <code>CDATASection</code> node in document order resulting from the
68 * split is returned by the <code>relatedData</code> attribute.
70 public String getType();
73 * The related platform dependent exception if any.
75 public Object getRelatedException();
78 * The related <code>DOMError.type</code> dependent data if any.
80 public Object getRelatedData();
83 * The location of the error.
85 public DOMLocator getLocation();