JAXB Plugins for wsdl2java
🧪Experimental • 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
,strict
orskip
) for wildcard properties. -
setters
- generate setters for collection fields. By default, a copy of the passed-in collection is set. Addsetters-mode=direct
to set the passed in collection instance directly. -
simplify
(untested) -
enumValue
- make enums implement theEnumValue<T>
interface allowing generic access to the original enum values. -
jaxbindex
- generate a per-packagejaxb.index
file 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 schemadefault
attribute. -
fluent-api
- generate awith*
method returning the class instance for everyset*
method that returnsvoid
. -
namespace-prefix
- adds@jakarta.xml.bind.annotation.XmlNs
annotations topackage-info.java
files. 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.xml
file that needs to be passed viaquarkus.cxf.codegen.wsdl2java.bindings
orquarkus.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_NAME
FIRSTNAME
FirstName
FOOBar
FOOBar
FooBar
SSNCode
SSNCode
SsnCode
-
xmlElementWrapper
(untested) - support@XmlElementWrapper
collection generation (without the need of inner class). -
parentPointer
(untested) - adds a field that points to the parent object -
inject-listener-code
- broken, useproperty-listener
fromio.quarkiverse.cxf:quarkus-cxf-xjc-plugins
instead.