src/java.xml/share/classes/jdk/xml/internal/SecuritySupport.java
Print this page
@@ -81,10 +81,26 @@
AccessController.doPrivileged(
(PrivilegedAction<String>) () -> (String)System.getProperty(propName));
}
/**
+ * Reads boolean type system property.
+ *
+ * @param propName the name of the property
+ * @param defValue the default value
+ * @return the value of the property, or the default value of no system
+ * property is found
+ */
+ public static boolean getJAXPSystemProperty(String propName, boolean defValue) {
+ String value = getJAXPSystemProperty(propName);
+ if (value == null) {
+ return defValue;
+ }
+ return Boolean.parseBoolean(value);
+ }
+
+ /**
* Reads JAXP system property in this order: system property,
* $java.home/conf/jaxp.properties if the system property is not specified
*
* @param propName the name of the property
* @return the value of the property