JAXB Plugins for wsdl2java
Stable • Since 3.23.0
Embeds XJC plugins from org.jvnet.jaxb:jaxb-plugins
for wsdl2java code generation.
Maven coordinates
Create a new project using quarkus-cxf-jaxb-plugins on code.quarkus.io
or add these coordinates to your existing project:
<dependency>
<groupId>io.quarkiverse.cxf</groupId>
<artifactId>quarkus-cxf-jaxb-plugins</artifactId>
</dependency>
|
Check the User guide and especially its Dependency management section for more information about writing applications with Quarkus CXF. |
Usage
|
Check the wsdl2java section of User guide for more details about |
Use this extension if you want to use any of the following
XJC plugins
in
quarkus.cxf.codegen.wsdl2java.xjc
or quarkus.cxf.codegen.wsdl2java."named-parameter-sets".xjc:
-
simpleEquals- add deep, reflection-free, runtime-freeequals()methods to the generated classes. -
simpleHashCode- add deep, reflection-free, runtime-freehashCode()methods to the schema-derived classes. -
equals- generateequals()methods with a pluggable equality strategy. -
hashCode- generatehashCode()methods with a pluggable hash code strategy. -
toString- add a reflection-free strategy-basedtoString()methods to the generated classes. -
copyable- generate methods for content copying with a pluggable custom copy creation strategy. -
mergeable- generatemerge()methods to merge data from two source objects into this object with a pluggable merge strategy. -
inheritance- let the generated classes extend certain class or implement certain interfaces. -
autoInheritance- force global elements or complex types to extend or extend certain class or implement certain interfaces. -
wildcard- specify wildcard mode (lax,strictorskip) for wildcard properties. -
setters- generate setters for collection fields. By default, a copy of the passed-in collection is set. Addsetters-mode=directto set the passed in collection instance directly. -
simplify- simplify "union" properties likefooOrBarOrBazgenerated from repeatable choices into several simple properties likefoo,bar,baz. -
enumValue- make enums implement theEnumValue<T>interface allowing generic access to the original enum values. -
jaxbindex- generate a per-packagejaxb.indexfile listing all of the schema-derived classes in the package. -
fixJAXB1058(untested) -
commons-lang- generate thetoString(),hashCode()andequals()methods using Apache commons-lang3. -
default-value- sets default values of fields based on the schemadefaultattribute. -
fluent-api- generate awith*method returning the class instance for everyset*method that returnsvoid. -
namespace-prefix- adds@jakarta.xml.bind.annotation.XmlNsannotations topackage-info.javafiles. Those annotations tell JAXB to generate XML schema instances with specific namespace prefixes, instead of the auto-generated (ns1,ns2, …) prefixes. Definition of those prefixes is done in a JAXBbindings.xmlfile that needs to be passed viaquarkus.cxf.codegen.wsdl2java.bindingsorquarkus.cxf.codegen.wsdl2java."named-parameter-sets".bindings. -
value-constructor- in addition to the default constructor, generate another constructor initializing every field. -
boolean-getter- name getter methods for boolean fieldsgetXXX()rather thanisXXX(). -
camelcase- always use CamelCase style for class names:Name example
XJC default
CamelCase
FIRST_NAMEFIRSTNAMEFirstNameFOOBarFOOBarFooBarSSNCodeSSNCodeSsnCode -
elementWrapper- annotate collection fields with@XmlElementWrapper(name = "…")instead of generating an extra class for the collection. -
parent-pointer- adds a field that points to the parent object. -
inject-listener-code- triggers a property change event on eachsetXXX()invocation; see alsoproperty-listenerfromio.quarkiverse.cxf:quarkus-cxf-xjc-plugins.