support disable xml sec in xjc ant task
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/jaxb-ri/docs/release-documentation/src/docbook/tools-xjc-ant-task.xml b/jaxb-ri/docs/release-documentation/src/docbook/tools-xjc-ant-task.xml
index bc03c16..d42231d 100644
--- a/jaxb-ri/docs/release-documentation/src/docbook/tools-xjc-ant-task.xml
+++ b/jaxb-ri/docs/release-documentation/src/docbook/tools-xjc-ant-task.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -133,6 +133,15 @@
</row>
<row>
+ <entry><para><literal>disableXmlSecurity</literal></para></entry>
+
+ <entry><para>Disable XML security features when parsing XML documents.
+ <literal>false</literal> by default.</para></entry>
+
+ <entry><para>No</para></entry>
+ </row>
+
+ <row>
<entry><para><literal>encoding</literal></para></entry>
<entry><para>Set the encoding name for generated
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
index 66cd11f..9c00aa6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
@@ -397,6 +397,17 @@
}
/**
+ * Controls whether to disable XML security features when parsing XML documents or not
+ */
+ public void setDisableXmlSecurity(boolean flg) {
+ this.options.disableXmlSecurity = flg;
+ }
+
+ public boolean getDisableXmlSecurity() {
+ return this.options.disableXmlSecurity;
+ }
+
+ /**
* Controls whether the file header comment is generated or not.
*/
public void setHeader(boolean flg) {
@@ -526,6 +537,10 @@
getCommandline().createArgument().setValue("-p");
getCommandline().createArgument().setValue(getPackage());
}
+ // disableXmlSecurity flag
+ if (getDisableXmlSecurity()) {
+ getCommandline().createArgument().setValue("-disableXmlSecurity");
+ }
// extension flag
if (getExtension()) {
getCommandline().createArgument().setValue("-extension");