Path: blob/master/src/java.xml/share/classes/jdk/xml/internal/JdkConstants.java
40948 views
/*1* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package jdk.xml.internal;2627/**28* This class holds constants shared across XML components. Historically, there29* had been a component boundary within which some constants were duplicated for30* each component, such as Xerces and Xalan.31*/32public final class JdkConstants {3334//35// Constants36//37//Xerces security manager38public static final String SECURITY_MANAGER =39"http://apache.org/xml/properties/security-manager";4041//42// Implementation limits: API properties43//4445/**46* Oracle JAXP property prefix.47*48* @deprecated Use {@code jdk.xml.} instead. Refer to specifications in49* the module summary.50*/51@Deprecated (since="17")52public static final String ORACLE_JAXP_PROPERTY_PREFIX =53"http://www.oracle.com/xml/jaxp/properties/";5455/**56* JDK entity expansion limit. Note that the existing system property57* "entityExpansionLimit" with no prefix is still observed.58*59* @deprecated Use {@link #SP_ENTITY_EXPANSION_LIMIT} instead.60*/61@Deprecated (since="17")62public static final String JDK_ENTITY_EXPANSION_LIMIT =63ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit";6465/**66* JDK element attribute limit. Note that the existing system property67* "elementAttributeLimit" with no prefix is still observed.68*69* @deprecated Use {@link #SP_ELEMENT_ATTRIBUTE_LIMIT} instead.70*/71@Deprecated (since="17")72public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT =73ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit";7475/**76* JDK maxOccur limit. Note that the existing system property77* "maxOccurLimit" with no prefix is still observed78*79* @deprecated Use {@link #SP_ENTITY_EXPANSION_LIMIT} instead.80*/81@Deprecated (since="17")82public static final String JDK_MAX_OCCUR_LIMIT =83ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit";8485/**86* JDK total entity size limit.87*88* @deprecated Use {@link #SP_TOTAL_ENTITY_SIZE_LIMIT} instead.89*/90@Deprecated (since="17")91public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT =92ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit";9394/**95* JDK maximum general entity size limit.96*97* @deprecated Use {@link #SP_GENERAL_ENTITY_SIZE_LIMIT} instead.98*/99@Deprecated (since="17")100public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT =101ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";102103/**104* JDK node count limit in entities that limits the total number of nodes105* in all of entity references.106*107* @deprecated Use {@link #SP_ENTITY_REPLACEMENT_LIMIT} instead.108*/109@Deprecated (since="17")110public static final String JDK_ENTITY_REPLACEMENT_LIMIT =111ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit";112113/**114* JDK maximum parameter entity size limit.115*116* @deprecated Use {@link #SP_PARAMETER_ENTITY_SIZE_LIMIT} instead.117*/118@Deprecated (since="17")119public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT =120ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit";121/**122* JDK maximum XML name limit.123*124* @deprecated Use {@link #SP_XML_NAME_LIMIT} instead.125*/126@Deprecated (since="17")127public static final String JDK_XML_NAME_LIMIT =128ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit";129130/**131* JDK maxElementDepth limit.132*133* @deprecated Use {@link #SP_MAX_ELEMENT_DEPTH} instead.134*/135@Deprecated (since="17")136public static final String JDK_MAX_ELEMENT_DEPTH =137ORACLE_JAXP_PROPERTY_PREFIX + "maxElementDepth";138139/**140* JDK property indicating whether the parser shall print out entity141* count information.142* Value: a string "yes" means print, "no" or any other string means not.143*144* @deprecated Use {@link #JDK_DEBUG_LIMIT} instead.145*/146@Deprecated (since="17")147public static final String JDK_ENTITY_COUNT_INFO =148ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo";149150public static final String JDK_DEBUG_LIMIT = "jdk.xml.getEntityCountInfo";151152//153// Implementation limits: corresponding System Properties of the above154// API properties.155//156// Note: as of JDK 17, properties and System properties now share the same157// name with a prefix "jdk.xml.".158//159/**160* JDK entity expansion limit; Note that the existing system property161* "entityExpansionLimit" with no prefix is still observed162*/163public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit";164165/**166* JDK element attribute limit; Note that the existing system property167* "elementAttributeLimit" with no prefix is still observed168*/169public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit";170171/**172* JDK maxOccur limit; Note that the existing system property173* "maxOccurLimit" with no prefix is still observed174*/175public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit";176177/**178* JDK total entity size limit179*/180public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit";181182/**183* JDK maximum general entity size limit184*/185public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";186187/**188* JDK node count limit in entities that limits the total number of nodes189* in all of entity references.190*/191public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit";192193/**194* JDK maximum parameter entity size limit195*/196public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit";197/**198* JDK maximum XML name limit199*/200public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit";201202/**203* JDK maxElementDepth limit204*/205public static final String SP_MAX_ELEMENT_DEPTH = "jdk.xml.maxElementDepth";206207/**208* JDK TransformerFactory and Transformer attribute that specifies a class209* loader that will be used for extension functions class loading210* Value: a "null", the default value, means that the default EF class loading211* path will be used.212* Instance of ClassLoader: the specified instance of ClassLoader will be used213* for extension functions loading during translation process214*/215public static final String JDK_EXTENSION_CLASSLOADER = "jdk.xml.transform.extensionClassLoader";216// spec-compatible name with a prefix "jdk.xml"217public static final String JDK_EXT_CLASSLOADER = "jdk.xml.extensionClassLoader";218219//legacy System Properties220public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";221public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;222public final static String MAX_OCCUR_LIMIT = "maxOccurLimit";223224/**225* A string "yes" that can be used for properties such as getEntityCountInfo226*/227public static final String JDK_YES = "yes";228229// Oracle Feature:230/**231* <p>Use Service Mechanism</p>232*233* <ul>234* <li>235* {@code true} instruct an object to use service mechanism to236* find a service implementation. This is the default behavior.237* </li>238* <li>239* {@code false} instruct an object to skip service mechanism and240* use the default implementation for that service.241* </li>242* </ul>243* @deprecated Use {@link jdk.xml.internal.JdkXmlUtils#OVERRIDE_PARSER} instead.244*/245@Deprecated (since="17")246public static final String ORACLE_FEATURE_SERVICE_MECHANISM =247"http://www.oracle.com/feature/use-service-mechanism";248249//System Properties corresponding to ACCESS_EXTERNAL_* properties250public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet";251public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD";252public static final String SP_ACCESS_EXTERNAL_SCHEMA = "javax.xml.accessExternalSchema";253254//all access keyword255public static final String ACCESS_EXTERNAL_ALL = "all";256257/**258* Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true259*/260public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";261262/**263* FEATURE_SECURE_PROCESSING (FSP) is false by default264*/265public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;266267public static final String XML_SECURITY_PROPERTY_MANAGER =268"jdk.xml.xmlSecurityPropertyManager";269270/**271* Values for a feature272*/273public static final String FEATURE_TRUE = "true";274public static final String FEATURE_FALSE = "false";275276/**277* For DOM Serializer.278*279* Indicates that the serializer should treat the output as a standalone document.280* The JDK specific standalone property controls whether a newline should be281* added after the XML header.282*283* @see similar property xsltcIsStandalone for XSLTC.284*/285public static final String S_IS_STANDALONE = "isStandalone";286287/**288* Fully-qualified property name with the JDK Impl prefix.289*290* @deprecated Use {@link #SP_IS_STANDALONE} instead.291*/292@Deprecated (since="17")293public static final String FQ_IS_STANDALONE = ORACLE_JAXP_PROPERTY_PREFIX + S_IS_STANDALONE;294295// Corresponding System property296public static final String SP_IS_STANDALONE = "jdk.xml.isStandalone";297298/**299* For XSLTC.300*301* Instructs the processor to act as if OutputKeys.STANDALONE is specified302* but without writing it out in the declaration.303* This property may be used to mitigate the effect of Xalan patch 1495 that304* has caused incompatible behaviors.305*/306/**307* <p>Is Standalone</p>308*309* <ul>310* <li>311* <code>yes</code> to indicate the output is intended to be used as standalone312* </li>313* <li>314* <code>no</code> has no effect.315* </li>316* </ul>317*318* @deprecated Use {@link #SP_XSLTC_IS_STANDALONE} instead.319*/320@Deprecated (since="17")321public static final String ORACLE_IS_STANDALONE = "http://www.oracle.com/xml/is-standalone";322323/**324* This property was added to align with those that used ORACLE_JAXP_PROPERTY_PREFIX325* as prefix.326* @deprecated Use {@link #SP_XSLTC_IS_STANDALONE} instead.327*/328@Deprecated (since="17")329public static final String JDK_IS_STANDALONE = ORACLE_JAXP_PROPERTY_PREFIX +330"xsltcIsStandalone";331332// Corresponding System property333public static final String SP_XSLTC_IS_STANDALONE = "jdk.xml.xsltcIsStandalone";334335/**336* Feature enableExtensionFunctions337*/338public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =339ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";340public static final String SP_ENABLE_EXTENSION_FUNCTION =341"javax.xml.enableExtensionFunctions";342// This is the correct name by the spec343public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC =344"jdk.xml.enableExtensionFunctions";345346/**347* Reset SymbolTable feature System property name is identical to feature348* name349*/350public final static String RESET_SYMBOL_TABLE = "jdk.xml.resetSymbolTable";351/**352* Default value of RESET_SYMBOL_TABLE. This will read the System property353*/354public static final boolean RESET_SYMBOL_TABLE_DEFAULT355= SecuritySupport.getJAXPSystemProperty(Boolean.class, RESET_SYMBOL_TABLE, "false");356357/**358* jdk.xml.overrideDefaultParser: enables the use of a 3rd party's parser359* implementation to override the system-default parser.360*/361public static final String OVERRIDE_PARSER = "jdk.xml.overrideDefaultParser";362public static final boolean OVERRIDE_PARSER_DEFAULT = SecuritySupport.getJAXPSystemProperty(363Boolean.class, OVERRIDE_PARSER, "false");364365/**366* instructs the parser to return the data in a CData section in a single chunk367* when the property is zero or unspecified, or in multiple chunks when it is368* greater than zero. The parser shall split the data by linebreaks, and any369* chunks that are larger than the specified size to ones that are equal to370* or smaller than the size.371*/372public final static String CDATA_CHUNK_SIZE = "jdk.xml.cdataChunkSize";373public static final int CDATA_CHUNK_SIZE_DEFAULT374= SecuritySupport.getJAXPSystemProperty(Integer.class, CDATA_CHUNK_SIZE, "0");375376}377378379