Wi will use it when having default fields in some XSD.
<strict>true</strict>
<verbose>true</verbose>
+
+ <!--
+ By means of this plugin 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 attribute "default" when
+ trying to find the default value to be returned when no other value
+ is available in the Java object.
+ -->
+ <args>
+ <arg>-Xdefault-value</arg>
+ </args>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.jaxb2_commons</groupId>
+ <artifactId>jaxb2-default-value</artifactId>
+ <version>1.1</version>
+ </plugin>
+ </plugins>
</configuration>
</plugin>
</plugins>
<!-- 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 jaxb2-default-value."/>
<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 jaxb2-default-value."/>
<xsd:element name="elements" type="elementType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>