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:

    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);

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


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


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


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


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

To use with Maven