Source code: org/apache/xerces/dom3/DOMError.java
1 /*
2 * Copyright (c) 2003 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
13 package org.apache.xerces.dom3;
14
15 /**
16 * <code>DOMError</code> is an interface that describes an error.
17 * <p>See also the <a href='http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107'>Document Object Model (DOM) Level 3 Core Specification</a>.
18 * @since DOM Level 3
19 */
20 public interface DOMError {
21 // ErrorSeverity
22 /**
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>.
27 */
28 public static final short SEVERITY_WARNING = 1;
29 /**
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>.
34 */
35 public static final short SEVERITY_ERROR = 2;
36 /**
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 and the return value of
40 * <code>DOMErrorHandler.handleError()</code> is ignored. If the
41 * implementation chooses to continue, the behavior is undefined.
42 */
43 public static final short SEVERITY_FATAL_ERROR = 3;
44
45 /**
46 * The severity of the error, either <code>SEVERITY_WARNING</code>,
47 * <code>SEVERITY_ERROR</code>, or <code>SEVERITY_FATAL_ERROR</code>.
48 */
49 public short getSeverity();
50
51 /**
52 * An implementation specific string describing the error that occurred.
53 */
54 public String getMessage();
55
56 /**
57 * A <code>DOMString</code> indicating which related data is expected in
58 * <code>relatedData</code>. Users should refer to the specification of
59 * the error in order to find its <code>DOMString</code> type and
60 * <code>relatedData</code> definitions if any.
61 * <p ><b>Note:</b> As an example,
62 * <code>Document.normalizeDocument()</code> does generate warnings when
63 * the "split-cdata-sections" parameter is in use. Therefore, the method
64 * generates a <code>SEVERITY_WARNING</code> with <code>type</code>
65 * <code>"cdata-section-splitted"</code> and the first
66 * <code>CDATASection</code> node in document order resulting from the
67 * split is returned by the <code>relatedData</code> attribute.
68 */
69 public String getType();
70
71 /**
72 * The related platform dependent exception if any.
73 */
74 public Object getRelatedException();
75
76 /**
77 * The related <code>DOMError.type</code> dependent data if any.
78 */
79 public Object getRelatedData();
80
81 /**
82 * The location of the error.
83 */
84 public DOMLocator getLocation();
85
86 }