< prev index next >
src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java
Print this page
*** 40,61 ****
*/
public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
public static final String SP_ENABLE_EXTENSION_FUNCTION =
"javax.xml.enableExtensionFunctions";
public static final String CATALOG_FEATURES = "javax.xml.catalog.catalogFeatures";
public final static String PROPERTY_USE_CATALOG = XMLConstants.USE_CATALOG;
public static enum XmlFeature {
/**
* Feature enableExtensionFunctions
! * FSP: extension function is enforced by FSP. When FSP is on, entension
* function is disabled.
*/
ENABLE_EXTENSION_FUNCTION(ORACLE_ENABLE_EXTENSION_FUNCTION,
! SP_ENABLE_EXTENSION_FUNCTION, true, false, true, true),
/**
* The {@link javax.xml.XMLConstants.USE_CATALOG} feature.
* FSP: USE_CATALOG is not enforced by FSP.
*/
USE_CATALOG(PROPERTY_USE_CATALOG, SP_USE_CATALOG, true, false, true, false);
--- 40,64 ----
*/
public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
public static final String SP_ENABLE_EXTENSION_FUNCTION =
"javax.xml.enableExtensionFunctions";
+ // This is the correct name by the spec
+ public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC =
+ "jdk.xml.enableExtensionFunctions";
public static final String CATALOG_FEATURES = "javax.xml.catalog.catalogFeatures";
public final static String PROPERTY_USE_CATALOG = XMLConstants.USE_CATALOG;
public static enum XmlFeature {
/**
* Feature enableExtensionFunctions
! * FSP: extension function is enforced by FSP. When FSP is on, extension
* function is disabled.
*/
ENABLE_EXTENSION_FUNCTION(ORACLE_ENABLE_EXTENSION_FUNCTION,
! SP_ENABLE_EXTENSION_FUNCTION_SPEC, true, false, true, true),
/**
* The {@link javax.xml.XMLConstants.USE_CATALOG} feature.
* FSP: USE_CATALOG is not enforced by FSP.
*/
USE_CATALOG(PROPERTY_USE_CATALOG, SP_USE_CATALOG, true, false, true, false);
*** 147,156 ****
--- 150,183 ----
}
}
/**
+ * Maps old property names with the new ones. This map is used to keep track of
+ * name changes so that old or incorrect names continue to be supported for compatibility.
+ */
+ public static enum NameMap {
+
+ ENABLE_EXTENSION_FUNCTION(SP_ENABLE_EXTENSION_FUNCTION_SPEC, SP_ENABLE_EXTENSION_FUNCTION);
+
+ final String newName;
+ final String oldName;
+
+ NameMap(String newName, String oldName) {
+ this.newName = newName;
+ this.oldName = oldName;
+ }
+
+ String getOldName(String newName) {
+ if (newName.equals(this.newName)) {
+ return oldName;
+ }
+ return null;
+ }
+ }
+
+ /**
* States of the settings of a property, in the order: default value, value
* set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
* properties, and jaxp api properties
*/
public static enum State {
*** 314,323 ****
--- 341,359 ----
* Read from system properties, or those in jaxp.properties
*/
private void readSystemProperties() {
for (XmlFeature feature : XmlFeature.values()) {
getSystemProperty(feature, feature.systemProperty());
+ if (!getSystemProperty(feature, feature.systemProperty())) {
+ //if system property is not found, try the older form if any
+ for (NameMap nameMap : NameMap.values()) {
+ String oldName = nameMap.getOldName(feature.systemProperty());
+ if (oldName != null) {
+ getSystemProperty(feature, oldName);
+ }
+ }
+ }
}
}
/**
* Read from system properties, or those in jaxp.properties
< prev index next >