<configuration>
<fork>true</fork>
<extensions>
+ <!--
+ By means of the CXF XJC Default Value Plugin (cxf-xjc-dv) Java objects
+ will return (as default value) their default values declared in the XSD file.
+ This feature is not found in the xjc Java tool.
+
+ It is using the XSD attributes "default", "maxocurrs", "minocurrs" when
+ trying to find the default value to be returned when no other value
+ is available in the Java object.
+
+ For using
+ a) default plugin's behaviour:
+ <extensionArgs>
+ <extraarg>-Xdv</extraarg> Initialize fields mapped from elements with their default values
+ </extensionArgs>
+ b) optional plugin's behaviour:
+ <extensionArgs>
+ <extraarg>-Xdv:optional</extraarg> Initialize fields mapped from elements with their default values
+ </extensionArgs> for elements with minOccurs=0 but with complexTypes containing
+ fields with default values.
+ -->
<extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:3.0.3</extension>
</extensions>
</configuration>
<xsd>${project.xsd.schemas.source.path}/parent.xsd</xsd>
<bindingFile>${project.bindings.path}/custombinding.xjb</bindingFile>
<packagename>${project.xsd.schemas.package.name}</packagename>
+ <extensionArgs>
+ <extraarg>-Xdv:optional</extraarg>
+ </extensionArgs>
</xsdOption>
</xsdOptions>
</configuration>
<!-- WARNING: I DO NOT KNOW WHY BUT TYPES WORK BETTER WITH JAXB IF THEY END WITH THE Type SUFFIX!!!! :/ -->
<xsd:complexType name="elementType">
<xsd:sequence>
- <xsd:element name="message" type="xsd:string"/>
+ <xsd:element name="message" type="xsd:string" default="This is a default message. Used by cxf-xjc-dv."/>
<xsd:element name="messageArgs" type="xsd:string" minOccurs="0" maxOccurs="100"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element id="GeneralFault" name="GeneralFault">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="technicalError" type="xsd:string" />
+ <xsd:element name="technicalError" type="xsd:string" default="This is a default error. Used by cxf-xjc-dv."/>
<xsd:element name="elements" type="elementType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
+ <version>3.0.3</version>
<configuration>
<fork>true</fork>
<extensions>
+ <!--
+ By means of the CXF XJC Default Value Plugin (cxf-xjc-dv) Java objects
+ will return (as default value) their default values declared in the XSD file.
+ This feature is not found in the xjc Java tool.
+
+ It is using the XSD attributes "default", "maxocurrs", "minocurrs" when
+ trying to find the default value to be returned when no other value
+ is available in the Java object.
+
+ For using
+ a) default plugin's behaviour:
+ <extensionArgs>
+ <extraarg>-Xdv</extraarg> Initialize fields mapped from elements with their default values
+ </extensionArgs>
+ b) optional plugin's behaviour:
+ <extensionArgs>
+ <extraarg>-Xdv:optional</extraarg> Initialize fields mapped from elements with their default values
+ </extensionArgs> for elements with minOccurs=0 but with complexTypes containing
+ fields with default values.
+
+ FOR AN EXAMPLE SEE pom.xml IN web-services-spring-cxf-globalxsds
+ -->
<extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:3.0.3</extension>
</extensions>
</configuration>