|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -128,32 +128,30 @@ public abstract void error (SAXParseException exception)
|
128 | 128 |
|
129 | 129 |
|
130 | 130 | /**
|
131 |
| - * Receive notification of a non-recoverable error. |
| 131 | + * Receive notification of a non-recoverable, fatal error. |
132 | 132 | *
|
133 |
| - * <p><strong>There is an apparent contradiction between the |
134 |
| - * documentation for this method and the documentation for {@link |
135 |
| - * org.xml.sax.ContentHandler#endDocument}. Until this ambiguity |
136 |
| - * is resolved in a future major release, clients should make no |
137 |
| - * assumptions about whether endDocument() will or will not be |
138 |
| - * invoked when the parser has reported a fatalError() or thrown |
139 |
| - * an exception.</strong></p> |
| 133 | + * <p> |
| 134 | + * As defined in section 1.2 of the W3C XML 1.0 Recommendation, fatal errors |
| 135 | + * are those that would make it impossible for a parser to continue normal |
| 136 | + * processing. These include violation of a well-formedness constraint, |
| 137 | + * invalid encoding, and forbidden structural errors as described in the |
| 138 | + * W3C XML 1.0 Recommendation. |
140 | 139 | *
|
141 |
| - * <p>This corresponds to the definition of "fatal error" in |
142 |
| - * section 1.2 of the W3C XML 1.0 Recommendation. For example, a |
143 |
| - * parser would use this callback to report the violation of a |
144 |
| - * well-formedness constraint.</p> |
| 140 | + * @apiNote An application must assume that the parser can no longer perform |
| 141 | + * normal processing after reporting a fatal error and may stop by throwing |
| 142 | + * a {@link SAXException} without calling {@link ContentHandler#endDocument()}. |
| 143 | + * In addition, the parser cannot be expected to be able to return accurate |
| 144 | + * information about the logical structure on the rest of the document even |
| 145 | + * if it may be able to resume parsing. |
145 | 146 | *
|
146 |
| - * <p>The application must assume that the document is unusable |
147 |
| - * after the parser has invoked this method, and should continue |
148 |
| - * (if at all) only for the sake of collecting additional error |
149 |
| - * messages: in fact, SAX parsers are free to stop reporting any |
150 |
| - * other events once this method has been invoked.</p> |
| 147 | + * @implNote After invoking this method, the parser may stop processing by |
| 148 | + * throwing a {@link SAXException}, or implement a feature that can direct |
| 149 | + * it to continue after a fatal error. In the later case, it may report |
| 150 | + * events on the rest of the document without any guarantee of correctness. |
151 | 151 | *
|
152 | 152 | * @param exception The error information encapsulated in a
|
153 |
| - * SAX parse exception. |
154 |
| - * @exception org.xml.sax.SAXException Any SAX exception, possibly |
155 |
| - * wrapping another exception. |
156 |
| - * @see org.xml.sax.SAXParseException |
| 153 | + * {@link SAXParseException}. |
| 154 | + * @throws SAXException if the application chooses to discontinue the parsing |
157 | 155 | */
|
158 | 156 | public abstract void fatalError (SAXParseException exception)
|
159 | 157 | throws SAXException;
|
|
0 commit comments