author | ctornqvi |
Thu, 23 Apr 2015 12:47:23 -0700 | |
changeset 30286 | 7e076dc01291 |
parent 29419 | 534054ee6062 |
child 29999 | 8493f5fc1052 |
permissions | -rw-r--r-- |
12005 | 1 |
/* |
29419
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
2 |
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
12005 | 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 |
package javax.xml; |
|
27 |
||
28 |
/** |
|
29 |
* <p>Utility class to contain basic XML values as constants.</p> |
|
30 |
* |
|
31 |
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a> |
|
32 |
* @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a> |
|
33 |
* @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a> |
|
34 |
* @see <a href="http://www.w3.org/XML/xml-V10-2e-errata">XML 1.0 Second Edition Specification Errata</a> |
|
35 |
* @see <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</a> |
|
36 |
* @see <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a> |
|
37 |
* @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a> |
|
38 |
* @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a> |
|
39 |
* @since 1.5 |
|
40 |
**/ |
|
41 |
||
42 |
public final class XMLConstants { |
|
43 |
||
44 |
/** |
|
45 |
* <p>Private constructor to prevent instantiation.</p> |
|
46 |
*/ |
|
47 |
private XMLConstants() { |
|
48 |
} |
|
49 |
||
50 |
/** |
|
51 |
* <p>Namespace URI to use to represent that there is no Namespace.</p> |
|
52 |
* |
|
53 |
* <p>Defined by the Namespace specification to be "".</p> |
|
54 |
* |
|
55 |
* @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting"> |
|
56 |
* Namespaces in XML, 5.2 Namespace Defaulting</a> |
|
57 |
*/ |
|
58 |
public static final String NULL_NS_URI = ""; |
|
59 |
||
60 |
/** |
|
61 |
* <p>Prefix to use to represent the default XML Namespace.</p> |
|
62 |
* |
|
63 |
* <p>Defined by the XML specification to be "".</p> |
|
64 |
* |
|
65 |
* @see <a |
|
66 |
* href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
67 |
* Namespaces in XML, 3. Qualified Names</a> |
|
68 |
*/ |
|
69 |
public static final String DEFAULT_NS_PREFIX = ""; |
|
70 |
||
71 |
/** |
|
72 |
* <p>The official XML Namespace name URI.</p> |
|
73 |
* |
|
74 |
* <p>Defined by the XML specification to be |
|
17534 | 75 |
* "{@code http://www.w3.org/XML/1998/namespace}".</p> |
12005 | 76 |
* |
77 |
* @see <a |
|
78 |
* href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
79 |
* Namespaces in XML, 3. Qualified Names</a> |
|
80 |
*/ |
|
81 |
public static final String XML_NS_URI = |
|
82 |
"http://www.w3.org/XML/1998/namespace"; |
|
83 |
||
84 |
/** |
|
85 |
* <p>The official XML Namespace prefix.</p> |
|
86 |
* |
|
17534 | 87 |
* <p>Defined by the XML specification to be "{@code xml}".</p> |
12005 | 88 |
* |
89 |
* @see <a |
|
90 |
* href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
91 |
* Namespaces in XML, 3. Qualified Names<</a> |
|
92 |
*/ |
|
93 |
public static final String XML_NS_PREFIX = "xml"; |
|
94 |
||
95 |
/** |
|
96 |
* <p>The official XML attribute used for specifying XML Namespace |
|
97 |
* declarations, {@link #XMLNS_ATTRIBUTE |
|
98 |
* XMLConstants.XMLNS_ATTRIBUTE}, Namespace name URI.</p> |
|
99 |
* |
|
100 |
* <p>Defined by the XML specification to be |
|
17534 | 101 |
* "{@code http://www.w3.org/2000/xmlns/}".</p> |
12005 | 102 |
* |
103 |
* @see <a |
|
104 |
* href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
105 |
* Namespaces in XML, 3. Qualified Names</a> |
|
106 |
* @see <a |
|
107 |
* href="http://www.w3.org/XML/xml-names-19990114-errata"> |
|
108 |
* Namespaces in XML Errata</a> |
|
109 |
*/ |
|
110 |
public static final String XMLNS_ATTRIBUTE_NS_URI = |
|
111 |
"http://www.w3.org/2000/xmlns/"; |
|
112 |
||
113 |
/** |
|
114 |
* <p>The official XML attribute used for specifying XML Namespace |
|
115 |
* declarations.</p> |
|
116 |
* |
|
117 |
* <p>It is <strong><em>NOT</em></strong> valid to use as a |
|
118 |
* prefix. Defined by the XML specification to be |
|
17534 | 119 |
* "{@code xmlns}".</p> |
12005 | 120 |
* |
121 |
* @see <a |
|
122 |
* href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
123 |
* Namespaces in XML, 3. Qualified Names</a> |
|
124 |
*/ |
|
125 |
public static final String XMLNS_ATTRIBUTE = "xmlns"; |
|
126 |
||
127 |
/** |
|
128 |
* <p>W3C XML Schema Namespace URI.</p> |
|
129 |
* |
|
17534 | 130 |
* <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema}". |
12005 | 131 |
* |
132 |
* @see <a href= |
|
133 |
* "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> |
|
134 |
* XML Schema Part 1: |
|
135 |
* Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> |
|
136 |
*/ |
|
137 |
public static final String W3C_XML_SCHEMA_NS_URI = |
|
138 |
"http://www.w3.org/2001/XMLSchema"; |
|
139 |
||
140 |
/** |
|
141 |
* <p>W3C XML Schema Instance Namespace URI.</p> |
|
142 |
* |
|
17534 | 143 |
* <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema-instance}".</p> |
12005 | 144 |
* |
145 |
* @see <a href= |
|
146 |
* "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> |
|
147 |
* XML Schema Part 1: |
|
148 |
* Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> |
|
149 |
*/ |
|
150 |
public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = |
|
151 |
"http://www.w3.org/2001/XMLSchema-instance"; |
|
152 |
||
153 |
/** |
|
154 |
* <p>W3C XPath Datatype Namespace URI.</p> |
|
155 |
* |
|
17534 | 156 |
* <p>Defined to be "{@code http://www.w3.org/2003/11/xpath-datatypes}".</p> |
12005 | 157 |
* |
158 |
* @see <a href="http://www.w3.org/TR/xpath-datamodel">XQuery 1.0 and XPath 2.0 Data Model</a> |
|
159 |
*/ |
|
160 |
public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes"; |
|
161 |
||
162 |
/** |
|
163 |
* <p>XML Document Type Declaration Namespace URI as an arbitrary value.</p> |
|
164 |
* |
|
17534 | 165 |
* <p>Since not formally defined by any existing standard, arbitrarily define to be "{@code http://www.w3.org/TR/REC-xml}". |
12005 | 166 |
*/ |
167 |
public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml"; |
|
168 |
||
169 |
/** |
|
170 |
* <p>RELAX NG Namespace URI.</p> |
|
171 |
* |
|
17534 | 172 |
* <p>Defined to be "{@code http://relaxng.org/ns/structure/1.0}".</p> |
12005 | 173 |
* |
174 |
* @see <a href="http://relaxng.org/spec-20011203.html">RELAX NG Specification</a> |
|
175 |
*/ |
|
176 |
public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0"; |
|
177 |
||
178 |
/** |
|
179 |
* <p>Feature for secure processing.</p> |
|
180 |
* |
|
181 |
* <ul> |
|
182 |
* <li> |
|
17534 | 183 |
* {@code true} instructs the implementation to process XML securely. |
12005 | 184 |
* This may set limits on XML constructs to avoid conditions such as denial of service attacks. |
185 |
* </li> |
|
186 |
* <li> |
|
17534 | 187 |
* {@code false} instructs the implementation to process XML in accordance with the XML specifications |
188 |
* ignoring security issues such as limits on XML constructs to avoid conditions such as denial of service attacks. |
|
12005 | 189 |
* </li> |
190 |
* </ul> |
|
191 |
*/ |
|
192 |
public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; |
|
17534 | 193 |
|
194 |
||
195 |
/** |
|
196 |
* <p>Property: accessExternalDTD</p> |
|
197 |
* |
|
198 |
* <p> |
|
199 |
* Restrict access to external DTDs and external Entity References to the protocols specified. |
|
200 |
* If access is denied due to the restriction of this property, a runtime exception that |
|
201 |
* is specific to the context is thrown. In the case of {@link javax.xml.parsers.SAXParser} |
|
202 |
* for example, {@link org.xml.sax.SAXException} is thrown. |
|
203 |
* </p> |
|
204 |
* |
|
205 |
* <p> |
|
206 |
* <b>Value: </b> a list of protocols separated by comma. A protocol is the scheme portion of a |
|
207 |
* {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion |
|
208 |
* separated by colon. |
|
209 |
* A scheme is defined as: |
|
210 |
* |
|
211 |
* <blockquote> |
|
212 |
* scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> |
|
213 |
* where alpha = a-z and A-Z.<br><br> |
|
214 |
* |
|
215 |
* And the JAR protocol:<br> |
|
216 |
* |
|
217 |
* jar[:scheme]<br><br> |
|
218 |
* |
|
219 |
* Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by |
|
220 |
* {@link java.lang.Character#isSpaceChar } in the value will be ignored. |
|
221 |
* Examples of protocols are file, http, jar:file. |
|
222 |
* |
|
223 |
* </blockquote> |
|
224 |
*</p> |
|
225 |
* |
|
226 |
*<p> |
|
227 |
* <b>Default value:</b> The default value is implementation specific and therefore not specified. |
|
228 |
* The following options are provided for consideration: |
|
229 |
* <blockquote> |
|
230 |
* <UL> |
|
231 |
* <LI>an empty string to deny all access to external references;</LI> |
|
232 |
* <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> |
|
233 |
* <LI>the keyword "all" to grant permission to all protocols.</LI> |
|
234 |
*</UL><br> |
|
235 |
* When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations |
|
236 |
* restrict external connections by default, though this may cause problems for applications |
|
237 |
* that process XML/XSD/XSL with external references. |
|
238 |
* </blockquote> |
|
239 |
* </p> |
|
240 |
* |
|
241 |
* <p> |
|
242 |
* <b>Granting all access:</b> the keyword "all" grants permission to all protocols. |
|
243 |
* </p> |
|
244 |
* <p> |
|
245 |
* <b>System Property:</b> The value of this property can be set or overridden by |
|
246 |
* system property {@code javax.xml.accessExternalDTD}. |
|
247 |
* </p> |
|
248 |
* |
|
249 |
* <p> |
|
29419
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
250 |
* <b>jaxp.properties:</b> This configuration file is in standard |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
251 |
* {@link java.util.Properties} format and typically located in the {@code conf} |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
252 |
* directory of the Java installation. If the file exists and the system |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
253 |
* property is specified, its value will be used to override the default |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
254 |
* of the property. |
17534 | 255 |
* </p> |
256 |
* |
|
257 |
* <p> |
|
258 |
* |
|
259 |
* </p> |
|
260 |
* @since 1.7 |
|
261 |
*/ |
|
262 |
public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD"; |
|
263 |
||
264 |
/** |
|
265 |
* <p>Property: accessExternalSchema</p> |
|
266 |
* |
|
267 |
* <p> |
|
268 |
* Restrict access to the protocols specified for external reference set by the |
|
269 |
* schemaLocation attribute, Import and Include element. If access is denied |
|
270 |
* due to the restriction of this property, a runtime exception that is specific |
|
271 |
* to the context is thrown. In the case of {@link javax.xml.validation.SchemaFactory} |
|
272 |
* for example, org.xml.sax.SAXException is thrown. |
|
273 |
* </p> |
|
274 |
* <p> |
|
275 |
* <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a |
|
276 |
* {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion |
|
277 |
* separated by colon. |
|
278 |
* A scheme is defined as: |
|
279 |
* |
|
280 |
* <blockquote> |
|
281 |
* scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> |
|
282 |
* where alpha = a-z and A-Z.<br><br> |
|
283 |
* |
|
284 |
* And the JAR protocol:<br> |
|
285 |
* |
|
286 |
* jar[:scheme]<br><br> |
|
287 |
* |
|
288 |
* Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by |
|
289 |
* {@link java.lang.Character#isSpaceChar } in the value will be ignored. |
|
290 |
* Examples of protocols are file, http, jar:file. |
|
291 |
* |
|
292 |
* </blockquote> |
|
293 |
*</p> |
|
294 |
* |
|
295 |
*<p> |
|
296 |
* <b>Default value:</b> The default value is implementation specific and therefore not specified. |
|
297 |
* The following options are provided for consideration: |
|
298 |
* <blockquote> |
|
299 |
* <UL> |
|
300 |
* <LI>an empty string to deny all access to external references;</LI> |
|
301 |
* <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> |
|
302 |
* <LI>the keyword "all" to grant permission to all protocols.</LI> |
|
303 |
*</UL><br> |
|
304 |
* When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations |
|
305 |
* restrict external connections by default, though this may cause problems for applications |
|
306 |
* that process XML/XSD/XSL with external references. |
|
307 |
* </blockquote> |
|
308 |
* </p> |
|
309 |
* <p> |
|
310 |
* <b>Granting all access:</b> the keyword "all" grants permission to all protocols. |
|
311 |
* </p> |
|
312 |
* |
|
313 |
* <p> |
|
314 |
* <b>System Property:</b> The value of this property can be set or overridden by |
|
315 |
* system property {@code javax.xml.accessExternalSchema} |
|
316 |
* </p> |
|
317 |
* |
|
318 |
* <p> |
|
29419
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
319 |
* <b>jaxp.properties:</b> This configuration file is in standard |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
320 |
* {@link java.util.Properties} format and typically located in the {@code conf} |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
321 |
* directory of the Java installation. If the file exists and the system |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
322 |
* property is specified, its value will be used to override the default |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
323 |
* of the property. |
17534 | 324 |
* |
325 |
* @since 1.7 |
|
326 |
* </p> |
|
327 |
*/ |
|
328 |
public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema"; |
|
329 |
||
330 |
/** |
|
331 |
* <p>Property: accessExternalStylesheet</p> |
|
332 |
* |
|
333 |
* <p> |
|
334 |
* Restrict access to the protocols specified for external references set by the |
|
335 |
* stylesheet processing instruction, Import and Include element, and document function. |
|
336 |
* If access is denied due to the restriction of this property, a runtime exception |
|
337 |
* that is specific to the context is thrown. In the case of constructing new |
|
338 |
* {@link javax.xml.transform.Transformer} for example, |
|
339 |
* {@link javax.xml.transform.TransformerConfigurationException} |
|
340 |
* will be thrown by the {@link javax.xml.transform.TransformerFactory}. |
|
341 |
* </p> |
|
342 |
* <p> |
|
343 |
* <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a |
|
344 |
* {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion |
|
345 |
* separated by colon. |
|
346 |
* A scheme is defined as: |
|
347 |
* |
|
348 |
* <blockquote> |
|
349 |
* scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> |
|
350 |
* where alpha = a-z and A-Z.<br><br> |
|
351 |
* |
|
352 |
* And the JAR protocol:<br> |
|
353 |
* |
|
354 |
* jar[:scheme]<br><br> |
|
355 |
* |
|
356 |
* Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by |
|
357 |
* {@link java.lang.Character#isSpaceChar } in the value will be ignored. |
|
358 |
* Examples of protocols are file, http, jar:file. |
|
359 |
* |
|
360 |
* </blockquote> |
|
361 |
*</p> |
|
362 |
* |
|
363 |
*<p> |
|
364 |
* <b>Default value:</b> The default value is implementation specific and therefore not specified. |
|
365 |
* The following options are provided for consideration: |
|
366 |
* <blockquote> |
|
367 |
* <UL> |
|
368 |
* <LI>an empty string to deny all access to external references;</LI> |
|
369 |
* <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> |
|
370 |
* <LI>the keyword "all" to grant permission to all protocols.</LI> |
|
371 |
*</UL><br> |
|
372 |
* When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations |
|
373 |
* restrict external connections by default, though this may cause problems for applications |
|
374 |
* that process XML/XSD/XSL with external references. |
|
375 |
* </blockquote> |
|
376 |
* </p> |
|
377 |
* <p> |
|
378 |
* <b>Granting all access:</b> the keyword "all" grants permission to all protocols. |
|
379 |
* </p> |
|
380 |
* |
|
381 |
* <p> |
|
382 |
* <b>System Property:</b> The value of this property can be set or overridden by |
|
383 |
* system property {@code javax.xml.accessExternalStylesheet} |
|
384 |
* </p> |
|
385 |
* |
|
386 |
* <p> |
|
29419
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
387 |
* <b>jaxp.properties:</b> This configuration file is in standard |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
388 |
* {@link java.util.Properties} format and typically located in the {@code conf} |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
389 |
* directory of the Java installation. If the file exists and the system |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
390 |
* property is specified, its value will be used to override the default |
534054ee6062
8049378: Examine references to ${java.home}/lib in JAXP
joehw
parents:
27574
diff
changeset
|
391 |
* of the property. |
17534 | 392 |
* |
393 |
* @since 1.7 |
|
394 |
*/ |
|
395 |
public static final String ACCESS_EXTERNAL_STYLESHEET = "http://javax.xml.XMLConstants/property/accessExternalStylesheet"; |
|
396 |
||
12005 | 397 |
} |