CXF XJC toString Plugin

The CXF XJC toString Plugin provides and XJC plugin that updates the generated beans to implement toString methods to override the default Object.toString method. It uses Apache Commons Lang ToStringBuilder class to build the String, so commons-lang.jar needs to be available on the classpath.

It generates methods that look like:

The toString plugin can take a parameter to control what the generated toString method's style looks like.

-Xts

Activate plugin to add a toString() method to generated classes. Equivalent to: -Xts:style:org.apache.cxf.jaxb.JAXBToStringStyle.DEFAULT_STYLE

-Xts:style:multiline

Have toString produce multi line output. Equivalent to: -Xts:style:org.apache.cxf.jaxb.JAXBToStringStyle.MULTI_LINE_STYLE

-Xts:style:simple

Have toString produce single line terse output. Equivalent to: -Xts:style:org.apache.cxf.jaxb.JAXBToStringStyle.SIMPLE_STYLE

-Xts:style:org.apache.commons.lang.builder.ToStringStyle.FIELD

The full class+field name of the ToStringStyle to use.

To use with Maven