Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/src/java.xml/share/classes/jdk/xml/internal/JdkConstants.java
67862 views
1
/*
2
* Copyright (c) 2011, 2022, 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
package jdk.xml.internal;
27
28
/**
29
* This class holds constants shared across XML components. Historically, there
30
* had been a component boundary within which some constants were duplicated for
31
* each component, such as Xerces and Xalan.
32
*/
33
public final class JdkConstants {
34
35
//
36
// Constants
37
//
38
//Xerces security manager
39
public static final String SECURITY_MANAGER =
40
"http://apache.org/xml/properties/security-manager";
41
42
//
43
// Implementation limits: API properties
44
//
45
46
/**
47
* Oracle JAXP property prefix.
48
*
49
* @deprecated Use {@code jdk.xml.} instead. Refer to specifications in
50
* the module summary.
51
*/
52
@Deprecated (since="17")
53
public static final String ORACLE_JAXP_PROPERTY_PREFIX =
54
"http://www.oracle.com/xml/jaxp/properties/";
55
56
/**
57
* JDK entity expansion limit. Note that the existing system property
58
* "entityExpansionLimit" with no prefix is still observed.
59
*
60
* @deprecated Use {@link #SP_ENTITY_EXPANSION_LIMIT} instead.
61
*/
62
@Deprecated (since="17")
63
public static final String JDK_ENTITY_EXPANSION_LIMIT =
64
ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit";
65
66
/**
67
* JDK element attribute limit. Note that the existing system property
68
* "elementAttributeLimit" with no prefix is still observed.
69
*
70
* @deprecated Use {@link #SP_ELEMENT_ATTRIBUTE_LIMIT} instead.
71
*/
72
@Deprecated (since="17")
73
public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT =
74
ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit";
75
76
/**
77
* JDK maxOccur limit. Note that the existing system property
78
* "maxOccurLimit" with no prefix is still observed
79
*
80
* @deprecated Use {@link #SP_ENTITY_EXPANSION_LIMIT} instead.
81
*/
82
@Deprecated (since="17")
83
public static final String JDK_MAX_OCCUR_LIMIT =
84
ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit";
85
86
/**
87
* JDK total entity size limit.
88
*
89
* @deprecated Use {@link #SP_TOTAL_ENTITY_SIZE_LIMIT} instead.
90
*/
91
@Deprecated (since="17")
92
public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT =
93
ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit";
94
95
/**
96
* JDK maximum general entity size limit.
97
*
98
* @deprecated Use {@link #SP_GENERAL_ENTITY_SIZE_LIMIT} instead.
99
*/
100
@Deprecated (since="17")
101
public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT =
102
ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
103
104
/**
105
* JDK node count limit in entities that limits the total number of nodes
106
* in all of entity references.
107
*
108
* @deprecated Use {@link #SP_ENTITY_REPLACEMENT_LIMIT} instead.
109
*/
110
@Deprecated (since="17")
111
public static final String JDK_ENTITY_REPLACEMENT_LIMIT =
112
ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit";
113
114
/**
115
* JDK maximum parameter entity size limit.
116
*
117
* @deprecated Use {@link #SP_PARAMETER_ENTITY_SIZE_LIMIT} instead.
118
*/
119
@Deprecated (since="17")
120
public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT =
121
ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit";
122
/**
123
* JDK maximum XML name limit.
124
*
125
* @deprecated Use {@link #SP_XML_NAME_LIMIT} instead.
126
*/
127
@Deprecated (since="17")
128
public static final String JDK_XML_NAME_LIMIT =
129
ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit";
130
131
/**
132
* JDK maxElementDepth limit.
133
*
134
* @deprecated Use {@link #SP_MAX_ELEMENT_DEPTH} instead.
135
*/
136
@Deprecated (since="17")
137
public static final String JDK_MAX_ELEMENT_DEPTH =
138
ORACLE_JAXP_PROPERTY_PREFIX + "maxElementDepth";
139
140
/**
141
* JDK property indicating whether the parser shall print out entity
142
* count information.
143
* Value: a string "yes" means print, "no" or any other string means not.
144
*
145
* @deprecated Use {@link #JDK_DEBUG_LIMIT} instead.
146
*/
147
@Deprecated (since="17")
148
public static final String JDK_ENTITY_COUNT_INFO =
149
ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo";
150
151
public static final String JDK_DEBUG_LIMIT = "jdk.xml.getEntityCountInfo";
152
153
//
154
// Implementation limits: corresponding System Properties of the above
155
// API properties.
156
//
157
// Note: as of JDK 17, properties and System properties now share the same
158
// name with a prefix "jdk.xml.".
159
//
160
/**
161
* JDK entity expansion limit; Note that the existing system property
162
* "entityExpansionLimit" with no prefix is still observed
163
*/
164
public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit";
165
166
/**
167
* JDK element attribute limit; Note that the existing system property
168
* "elementAttributeLimit" with no prefix is still observed
169
*/
170
public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit";
171
172
/**
173
* JDK maxOccur limit; Note that the existing system property
174
* "maxOccurLimit" with no prefix is still observed
175
*/
176
public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit";
177
178
/**
179
* JDK total entity size limit
180
*/
181
public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit";
182
183
/**
184
* JDK maximum general entity size limit
185
*/
186
public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
187
188
/**
189
* JDK node count limit in entities that limits the total number of nodes
190
* in all of entity references.
191
*/
192
public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit";
193
194
/**
195
* JDK maximum parameter entity size limit
196
*/
197
public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit";
198
/**
199
* JDK maximum XML name limit
200
*/
201
public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit";
202
203
/**
204
* JDK maxElementDepth limit
205
*/
206
public static final String SP_MAX_ELEMENT_DEPTH = "jdk.xml.maxElementDepth";
207
208
/**
209
* JDK XPath Expression group limit
210
*/
211
public static final String XPATH_GROUP_LIMIT = "jdk.xml.xpathExprGrpLimit";
212
213
/**
214
* JDK XPath Expression operators limit
215
*/
216
public static final String XPATH_OP_LIMIT = "jdk.xml.xpathExprOpLimit";
217
218
/**
219
* JDK XSL XPath limit or Total Number of Operators Permitted in an XSL Stylesheet
220
*/
221
public static final String XPATH_TOTALOP_LIMIT = "jdk.xml.xpathTotalOpLimit";
222
223
/**
224
* JDK TransformerFactory and Transformer attribute that specifies a class
225
* loader that will be used for extension functions class loading
226
* Value: a "null", the default value, means that the default EF class loading
227
* path will be used.
228
* Instance of ClassLoader: the specified instance of ClassLoader will be used
229
* for extension functions loading during translation process
230
*/
231
public static final String JDK_EXTENSION_CLASSLOADER = "jdk.xml.transform.extensionClassLoader";
232
// spec-compatible name with a prefix "jdk.xml"
233
public static final String JDK_EXT_CLASSLOADER = "jdk.xml.extensionClassLoader";
234
235
//legacy System Properties
236
public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";
237
public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;
238
public final static String MAX_OCCUR_LIMIT = "maxOccurLimit";
239
240
/**
241
* A string "yes" that can be used for properties such as getEntityCountInfo
242
*/
243
public static final String JDK_YES = "yes";
244
245
// Oracle Feature:
246
/**
247
* <p>Use Service Mechanism</p>
248
*
249
* <ul>
250
* <li>
251
* {@code true} instruct an object to use service mechanism to
252
* find a service implementation. This is the default behavior.
253
* </li>
254
* <li>
255
* {@code false} instruct an object to skip service mechanism and
256
* use the default implementation for that service.
257
* </li>
258
* </ul>
259
* @deprecated Use {@link jdk.xml.internal.JdkXmlUtils#OVERRIDE_PARSER} instead.
260
*/
261
@Deprecated (since="17")
262
public static final String ORACLE_FEATURE_SERVICE_MECHANISM =
263
"http://www.oracle.com/feature/use-service-mechanism";
264
265
//System Properties corresponding to ACCESS_EXTERNAL_* properties
266
public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet";
267
public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD";
268
public static final String SP_ACCESS_EXTERNAL_SCHEMA = "javax.xml.accessExternalSchema";
269
270
//all access keyword
271
public static final String ACCESS_EXTERNAL_ALL = "all";
272
273
/**
274
* Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true
275
*/
276
public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";
277
278
/**
279
* FEATURE_SECURE_PROCESSING (FSP) is false by default
280
*/
281
public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
282
283
public static final String XML_SECURITY_PROPERTY_MANAGER =
284
"jdk.xml.xmlSecurityPropertyManager";
285
286
/**
287
* Values for a feature
288
*/
289
public static final String FEATURE_TRUE = "true";
290
public static final String FEATURE_FALSE = "false";
291
292
/**
293
* For DOM Serializer.
294
*
295
* Indicates that the serializer should treat the output as a standalone document.
296
* The JDK specific standalone property controls whether a newline should be
297
* added after the XML header.
298
*
299
* @see similar property xsltcIsStandalone for XSLTC.
300
*/
301
public static final String S_IS_STANDALONE = "isStandalone";
302
303
/**
304
* Fully-qualified property name with the JDK Impl prefix.
305
*
306
* @deprecated Use {@link #SP_IS_STANDALONE} instead.
307
*/
308
@Deprecated (since="17")
309
public static final String FQ_IS_STANDALONE = ORACLE_JAXP_PROPERTY_PREFIX + S_IS_STANDALONE;
310
311
// Corresponding System property
312
public static final String SP_IS_STANDALONE = "jdk.xml.isStandalone";
313
314
/**
315
* For XSLTC.
316
*
317
* Instructs the processor to act as if OutputKeys.STANDALONE is specified
318
* but without writing it out in the declaration.
319
* This property may be used to mitigate the effect of Xalan patch 1495 that
320
* has caused incompatible behaviors.
321
*/
322
/**
323
* <p>Is Standalone</p>
324
*
325
* <ul>
326
* <li>
327
* <code>yes</code> to indicate the output is intended to be used as standalone
328
* </li>
329
* <li>
330
* <code>no</code> has no effect.
331
* </li>
332
* </ul>
333
*
334
* @deprecated Use {@link #SP_XSLTC_IS_STANDALONE} instead.
335
*/
336
@Deprecated (since="17")
337
public static final String ORACLE_IS_STANDALONE = "http://www.oracle.com/xml/is-standalone";
338
339
/**
340
* This property was added to align with those that used ORACLE_JAXP_PROPERTY_PREFIX
341
* as prefix.
342
* @deprecated Use {@link #SP_XSLTC_IS_STANDALONE} instead.
343
*/
344
@Deprecated (since="17")
345
public static final String JDK_IS_STANDALONE = ORACLE_JAXP_PROPERTY_PREFIX +
346
"xsltcIsStandalone";
347
348
// Corresponding System property
349
public static final String SP_XSLTC_IS_STANDALONE = "jdk.xml.xsltcIsStandalone";
350
351
/**
352
* Feature enableExtensionFunctions
353
*/
354
public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
355
ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
356
public static final String SP_ENABLE_EXTENSION_FUNCTION =
357
"javax.xml.enableExtensionFunctions";
358
// This is the correct name by the spec
359
public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC =
360
"jdk.xml.enableExtensionFunctions";
361
362
/**
363
* Reset SymbolTable feature System property name is identical to feature
364
* name
365
*/
366
public final static String RESET_SYMBOL_TABLE = "jdk.xml.resetSymbolTable";
367
/**
368
* Default value of RESET_SYMBOL_TABLE. This will read the System property
369
*/
370
public static final boolean RESET_SYMBOL_TABLE_DEFAULT
371
= SecuritySupport.getJAXPSystemProperty(Boolean.class, RESET_SYMBOL_TABLE, "false");
372
373
/**
374
* jdk.xml.overrideDefaultParser: enables the use of a 3rd party's parser
375
* implementation to override the system-default parser.
376
*/
377
public static final String OVERRIDE_PARSER = "jdk.xml.overrideDefaultParser";
378
public static final boolean OVERRIDE_PARSER_DEFAULT = SecuritySupport.getJAXPSystemProperty(
379
Boolean.class, OVERRIDE_PARSER, "false");
380
381
/**
382
* instructs the parser to return the data in a CData section in a single chunk
383
* when the property is zero or unspecified, or in multiple chunks when it is
384
* greater than zero. The parser shall split the data by linebreaks, and any
385
* chunks that are larger than the specified size to ones that are equal to
386
* or smaller than the size.
387
*/
388
public final static String CDATA_CHUNK_SIZE = "jdk.xml.cdataChunkSize";
389
public static final int CDATA_CHUNK_SIZE_DEFAULT
390
= SecuritySupport.getJAXPSystemProperty(Integer.class, CDATA_CHUNK_SIZE, "0");
391
392
}
393
394