Path: blob/master/src/java.xml/share/classes/jdk/xml/internal/JdkConstants.java
67862 views
/*1* Copyright (c) 2011, 2022, 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 XPath Expression group limit209*/210public static final String XPATH_GROUP_LIMIT = "jdk.xml.xpathExprGrpLimit";211212/**213* JDK XPath Expression operators limit214*/215public static final String XPATH_OP_LIMIT = "jdk.xml.xpathExprOpLimit";216217/**218* JDK XSL XPath limit or Total Number of Operators Permitted in an XSL Stylesheet219*/220public static final String XPATH_TOTALOP_LIMIT = "jdk.xml.xpathTotalOpLimit";221222/**223* JDK TransformerFactory and Transformer attribute that specifies a class224* loader that will be used for extension functions class loading225* Value: a "null", the default value, means that the default EF class loading226* path will be used.227* Instance of ClassLoader: the specified instance of ClassLoader will be used228* for extension functions loading during translation process229*/230public static final String JDK_EXTENSION_CLASSLOADER = "jdk.xml.transform.extensionClassLoader";231// spec-compatible name with a prefix "jdk.xml"232public static final String JDK_EXT_CLASSLOADER = "jdk.xml.extensionClassLoader";233234//legacy System Properties235public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";236public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;237public final static String MAX_OCCUR_LIMIT = "maxOccurLimit";238239/**240* A string "yes" that can be used for properties such as getEntityCountInfo241*/242public static final String JDK_YES = "yes";243244// Oracle Feature:245/**246* <p>Use Service Mechanism</p>247*248* <ul>249* <li>250* {@code true} instruct an object to use service mechanism to251* find a service implementation. This is the default behavior.252* </li>253* <li>254* {@code false} instruct an object to skip service mechanism and255* use the default implementation for that service.256* </li>257* </ul>258* @deprecated Use {@link jdk.xml.internal.JdkXmlUtils#OVERRIDE_PARSER} instead.259*/260@Deprecated (since="17")261public static final String ORACLE_FEATURE_SERVICE_MECHANISM =262"http://www.oracle.com/feature/use-service-mechanism";263264//System Properties corresponding to ACCESS_EXTERNAL_* properties265public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet";266public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD";267public static final String SP_ACCESS_EXTERNAL_SCHEMA = "javax.xml.accessExternalSchema";268269//all access keyword270public static final String ACCESS_EXTERNAL_ALL = "all";271272/**273* Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true274*/275public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";276277/**278* FEATURE_SECURE_PROCESSING (FSP) is false by default279*/280public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;281282public static final String XML_SECURITY_PROPERTY_MANAGER =283"jdk.xml.xmlSecurityPropertyManager";284285/**286* Values for a feature287*/288public static final String FEATURE_TRUE = "true";289public static final String FEATURE_FALSE = "false";290291/**292* For DOM Serializer.293*294* Indicates that the serializer should treat the output as a standalone document.295* The JDK specific standalone property controls whether a newline should be296* added after the XML header.297*298* @see similar property xsltcIsStandalone for XSLTC.299*/300public static final String S_IS_STANDALONE = "isStandalone";301302/**303* Fully-qualified property name with the JDK Impl prefix.304*305* @deprecated Use {@link #SP_IS_STANDALONE} instead.306*/307@Deprecated (since="17")308public static final String FQ_IS_STANDALONE = ORACLE_JAXP_PROPERTY_PREFIX + S_IS_STANDALONE;309310// Corresponding System property311public static final String SP_IS_STANDALONE = "jdk.xml.isStandalone";312313/**314* For XSLTC.315*316* Instructs the processor to act as if OutputKeys.STANDALONE is specified317* but without writing it out in the declaration.318* This property may be used to mitigate the effect of Xalan patch 1495 that319* has caused incompatible behaviors.320*/321/**322* <p>Is Standalone</p>323*324* <ul>325* <li>326* <code>yes</code> to indicate the output is intended to be used as standalone327* </li>328* <li>329* <code>no</code> has no effect.330* </li>331* </ul>332*333* @deprecated Use {@link #SP_XSLTC_IS_STANDALONE} instead.334*/335@Deprecated (since="17")336public static final String ORACLE_IS_STANDALONE = "http://www.oracle.com/xml/is-standalone";337338/**339* This property was added to align with those that used ORACLE_JAXP_PROPERTY_PREFIX340* as prefix.341* @deprecated Use {@link #SP_XSLTC_IS_STANDALONE} instead.342*/343@Deprecated (since="17")344public static final String JDK_IS_STANDALONE = ORACLE_JAXP_PROPERTY_PREFIX +345"xsltcIsStandalone";346347// Corresponding System property348public static final String SP_XSLTC_IS_STANDALONE = "jdk.xml.xsltcIsStandalone";349350/**351* Feature enableExtensionFunctions352*/353public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =354ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";355public static final String SP_ENABLE_EXTENSION_FUNCTION =356"javax.xml.enableExtensionFunctions";357// This is the correct name by the spec358public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC =359"jdk.xml.enableExtensionFunctions";360361/**362* Reset SymbolTable feature System property name is identical to feature363* name364*/365public final static String RESET_SYMBOL_TABLE = "jdk.xml.resetSymbolTable";366/**367* Default value of RESET_SYMBOL_TABLE. This will read the System property368*/369public static final boolean RESET_SYMBOL_TABLE_DEFAULT370= SecuritySupport.getJAXPSystemProperty(Boolean.class, RESET_SYMBOL_TABLE, "false");371372/**373* jdk.xml.overrideDefaultParser: enables the use of a 3rd party's parser374* implementation to override the system-default parser.375*/376public static final String OVERRIDE_PARSER = "jdk.xml.overrideDefaultParser";377public static final boolean OVERRIDE_PARSER_DEFAULT = SecuritySupport.getJAXPSystemProperty(378Boolean.class, OVERRIDE_PARSER, "false");379380/**381* instructs the parser to return the data in a CData section in a single chunk382* when the property is zero or unspecified, or in multiple chunks when it is383* greater than zero. The parser shall split the data by linebreaks, and any384* chunks that are larger than the specified size to ones that are equal to385* or smaller than the size.386*/387public final static String CDATA_CHUNK_SIZE = "jdk.xml.cdataChunkSize";388public static final int CDATA_CHUNK_SIZE_DEFAULT389= SecuritySupport.getJAXPSystemProperty(Integer.class, CDATA_CHUNK_SIZE, "0");390391}392393394