Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.xml/share/classes/org/xml/sax/package-info.java
40948 views
1
/*
2
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
/**
27
* Provides the interfaces for the Simple API for XML (SAX). Supports both
28
* the SAX1 and SAX2 APIs.
29
*
30
* <h2> SAX2 Standard Feature Flags </h2>
31
*
32
* <p>
33
* One of the essential characteristics of SAX2 is that it added
34
* feature flags which can be used to examine and perhaps modify
35
* parser modes, in particular modes such as validation.
36
* Since features are identified by (absolute) URIs, anyone
37
* can define such features.
38
* Currently defined standard feature URIs have the prefix
39
* <code>http://xml.org/sax/features/</code> before an identifier such as
40
* <code>validation</code>. Turn features on or off using
41
* <em>setFeature</em>. Those standard identifiers are:
42
*
43
*
44
* <table class="striped">
45
* <caption>Standard Features</caption>
46
* <thead>
47
* <tr>
48
* <th scope="col">Feature ID</th>
49
* <th scope="col">Access</th>
50
* <th scope="col">Default</th>
51
* <th scope="col">Description</th>
52
* </tr>
53
* </thead>
54
*
55
* <tbody>
56
* <tr>
57
* <th scope="row">external-general-entities</th>
58
* <td><em>read/write</em></td>
59
* <td><em>unspecified</em></td>
60
* <td> Reports whether this parser processes external
61
* general entities; always true if validating.
62
* </td>
63
* </tr>
64
*
65
* <tr>
66
* <th scope="row">external-parameter-entities</th>
67
* <td><em>read/write</em></td>
68
* <td><em>unspecified</em></td>
69
* <td> Reports whether this parser processes external
70
* parameter entities; always true if validating.
71
* </td>
72
* </tr>
73
*
74
* <tr>
75
* <th scope="row">is-standalone</th>
76
* <td>(parsing) <em>read-only</em>, (not parsing) <em>none</em></td>
77
* <td>not applicable</td>
78
* <td> May be examined only during a parse, after the
79
* <em>startDocument()</em> callback has been completed; read-only.
80
* The value is true if the document specified standalone="yes" in
81
* its XML declaration, and otherwise is false.
82
* </td>
83
* </tr>
84
*
85
* <tr>
86
* <th scope="row">lexical-handler/parameter-entities</th>
87
* <td><em>read/write</em></td>
88
* <td><em>unspecified</em></td>
89
* <td> A value of "true" indicates that the LexicalHandler will report
90
* the beginning and end of parameter entities.
91
* </td>
92
* </tr>
93
*
94
* <tr>
95
* <th scope="row">namespaces</th>
96
* <td><em>read/write</em></td>
97
* <td>true</td>
98
* <td> A value of "true" indicates namespace URIs and unprefixed local names
99
* for element and attribute names will be available.
100
* </td>
101
* </tr>
102
*
103
* <tr>
104
* <th scope="row">namespace-prefixes</th>
105
* <td><em>read/write</em></td>
106
* <td>false</td>
107
* <td> A value of "true" indicates that XML qualified names (with prefixes) and
108
* attributes (including <em>xmlns*</em> attributes) will be available.
109
* </td>
110
* </tr>
111
*
112
* <tr>
113
* <th scope="row">resolve-dtd-uris</th>
114
* <td><em>read/write</em></td>
115
* <td><em>true</em></td>
116
* <td> A value of "true" indicates that system IDs in declarations will
117
* be absolutized (relative to their base URIs) before reporting.
118
* (That is the default behavior for all SAX2 XML parsers.)
119
* A value of "false" indicates those IDs will not be absolutized;
120
* parsers will provide the base URI from
121
* <em>Locator.getSystemId()</em>.
122
* This applies to system IDs passed in <ul>
123
* <li><em>DTDHandler.notationDecl()</em>,
124
* <li><em>DTDHandler.unparsedEntityDecl()</em>, and
125
* <li><em>DeclHandler.externalEntityDecl()</em>.
126
* </ul>
127
* It does not apply to <em>EntityResolver.resolveEntity()</em>,
128
* which is not used to report declarations, or to
129
* <em>LexicalHandler.startDTD()</em>, which already provides
130
* the non-absolutized URI.
131
* </td>
132
* </tr>
133
*
134
* <tr>
135
* <th scope="row">string-interning</th>
136
* <td><em>read/write</em></td>
137
* <td><em>unspecified</em></td>
138
* <td> Has a value of "true" if all XML names (for elements, prefixes,
139
* attributes, entities, notations, and local names),
140
* as well as Namespace URIs, will have been interned
141
* using <em>java.lang.String.intern</em>. This supports fast
142
* testing of equality/inequality against string constants,
143
* rather than forcing slower calls to <em>String.equals()</em>.
144
* </td>
145
* </tr>
146
*
147
* <tr>
148
* <th scope="row">unicode-normalization-checking</th>
149
* <td><em>read/write</em></td>
150
* <td><em>false</em></td>
151
* <td> Controls whether the parser reports Unicode normalization
152
* errors as described in section 2.13 and Appendix B of the
153
* XML 1.1 Recommendation. If true, Unicode normalization
154
* errors are reported using the ErrorHandler.error() callback.
155
* Such errors are not fatal in themselves (though, obviously,
156
* other Unicode-related encoding errors may be).
157
* </td>
158
* </tr>
159
*
160
* <tr>
161
* <th scope="row">use-attributes2</th>
162
* <td><em>read-only</em></td>
163
* <td>not applicable</td>
164
* <td> Returns "true" if the <em>Attributes</em> objects passed by
165
* this parser in <em>ContentHandler.startElement()</em>
166
* implement the <a href="ext/Attributes2.html"
167
* ><em>org.xml.sax.ext.Attributes2</em></a> interface.
168
* That interface exposes additional DTD-related information,
169
* such as whether the attribute was specified in the
170
* source text rather than defaulted.
171
* </td>
172
* </tr>
173
*
174
* <tr>
175
* <th scope="row">use-locator2</th>
176
* <td><em>read-only</em></td>
177
* <td>not applicable</td>
178
* <td> Returns "true" if the <em>Locator</em> objects passed by
179
* this parser in <em>ContentHandler.setDocumentLocator()</em>
180
* implement the <a href="ext/Locator2.html"
181
* ><em>org.xml.sax.ext.Locator2</em></a> interface.
182
* That interface exposes additional entity information,
183
* such as the character encoding and XML version used.
184
* </td>
185
* </tr>
186
*
187
* <tr>
188
* <th scope="row">use-entity-resolver2</th>
189
* <td><em>read/write</em></td>
190
* <td><em>true</em></td>
191
* <td> Returns "true" if, when <em>setEntityResolver</em> is given
192
* an object implementing the <a href="ext/EntityResolver2.html"
193
* ><em>org.xml.sax.ext.EntityResolver2</em></a> interface,
194
* those new methods will be used.
195
* Returns "false" to indicate that those methods will not be used.
196
* </td>
197
* </tr>
198
*
199
* <tr>
200
* <th scope="row">validation</th>
201
* <td><em>read/write</em></td>
202
* <td><em>unspecified</em></td>
203
* <td> Controls whether the parser is reporting all validity
204
* errors; if true, all external entities will be read.
205
* </td>
206
* </tr>
207
*
208
* <tr>
209
* <th scope="row">xmlns-uris</th>
210
* <td><em>read/write</em></td>
211
* <td><em>false</em></td>
212
* <td> Controls whether, when the <em>namespace-prefixes</em> feature
213
* is set, the parser treats namespace declaration attributes as
214
* being in the <em>http://www.w3.org/2000/xmlns/</em> namespace.
215
* By default, SAX2 conforms to the original "Namespaces in XML"
216
* Recommendation, which explicitly states that such attributes are
217
* not in any namespace.
218
* Setting this optional flag to "true" makes the SAX2 events conform to
219
* a later backwards-incompatible revision of that recommendation,
220
* placing those attributes in a namespace.
221
* </td>
222
* </tr>
223
*
224
* <tr>
225
* <th scope="row">xml-1.1</th>
226
* <td><em>read-only</em></td>
227
* <td>not applicable</td>
228
* <td> Returns "true" if the parser supports both XML 1.1 and XML 1.0.
229
* Returns "false" if the parser supports only XML 1.0.
230
* </td>
231
* </tr>
232
* </tbody>
233
* </table>
234
*
235
* <p>
236
* Support for the default values of the
237
* <em>namespaces</em> and <em>namespace-prefixes</em>
238
* properties is required.
239
* Support for any other feature flags is entirely optional.
240
*
241
*
242
* <p>
243
* For default values not specified by SAX2,
244
* each XMLReader implementation specifies its default,
245
* or may choose not to expose the feature flag.
246
* Unless otherwise specified here,
247
* implementations may support changing current values
248
* of these standard feature flags, but not while parsing.
249
*
250
*
251
* <h2> SAX2 Standard Handler and Property IDs </h2>
252
*
253
* <p>
254
* For parser interface characteristics that are described
255
* as objects, a separate namespace is defined. The
256
* objects in this namespace are again identified by URI, and
257
* the standard property URIs have the prefix
258
* <code>http://xml.org/sax/properties/</code> before an identifier such as
259
* <code>lexical-handler</code> or
260
* <code>dom-node</code>. Manage those properties using
261
* <em>setProperty()</em>. Those identifiers are:
262
*
263
* <table class="striped">
264
* <caption>Standard Property IDs</caption>
265
* <thead>
266
* <tr>
267
* <th scope="col">Property ID</th>
268
* <th scope="col">Description</th>
269
* </tr>
270
* </thead>
271
*
272
* <tbody>
273
* <tr>
274
* <th scope="row">declaration-handler</th>
275
* <td> Used to see most DTD declarations except those treated
276
* as lexical ("document element name is ...") or which are
277
* mandatory for all SAX parsers (<em>DTDHandler</em>).
278
* The Object must implement <a href="ext/DeclHandler.html"
279
* ><em>org.xml.sax.ext.DeclHandler</em></a>.
280
* </td>
281
* </tr>
282
*
283
* <tr>
284
* <th scope="row">document-xml-version</th>
285
* <td> May be examined only during a parse, after the startDocument()
286
* callback has been completed; read-only. This property is a
287
* literal string describing the actual XML version of the document,
288
* such as "1.0" or "1.1".
289
* </td>
290
* </tr>
291
*
292
* <tr>
293
* <th scope="row">dom-node</th>
294
* <td> For "DOM Walker" style parsers, which ignore their
295
* <em>parser.parse()</em> parameters, this is used to
296
* specify the DOM (sub)tree being walked by the parser.
297
* The Object must implement the
298
* <em>org.w3c.dom.Node</em> interface.
299
* </td>
300
* </tr>
301
*
302
* <tr>
303
* <th scope="row">lexical-handler</th>
304
* <td> Used to see some syntax events that are essential in some
305
* applications: comments, CDATA delimiters, selected general
306
* entity inclusions, and the start and end of the DTD
307
* (and declaration of document element name).
308
* The Object must implement <a href="ext/LexicalHandler.html"
309
* ><em>org.xml.sax.ext.LexicalHandler</em></a>.
310
* </td>
311
* </tr>
312
*
313
* <tr>
314
* <th scope="row">xml-string</th>
315
* <td> Readable only during a parser callback, this exposes a <b>TBS</b>
316
* chunk of characters responsible for the current event.
317
* </td>
318
* </tr>
319
* </tbody>
320
* </table>
321
*
322
* <p>
323
* All of these standard properties are optional.
324
* XMLReader implementations are not required to support them.
325
*
326
* @apiNote The SAX API, originally developed at
327
* <a href="http://www.saxproject.org">the SAX Project</a>,
328
* has been defined by Java SE since 1.4.
329
*
330
* @since 1.4
331
*/
332
333
package org.xml.sax;
334
335