JAXB2 Commons

Plugins for JAXB2 RI XJC

License

License

GroupId

GroupId

com.btmatthews.jaxb2_commons
ArtifactId

ArtifactId

jaxb2-commons
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

JAXB2 Commons
Plugins for JAXB2 RI XJC
Project URL

Project URL

https://github.com/bmatthews68/jaxb2-commons
Project Organization

Project Organization

Brian Matthews
Source Code Management

Source Code Management

https://github.com/bmatthews68/jaxb2-commons

Download jaxb2-commons

Filename Size
jaxb2-commons-1.0.0.pom 11 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.btmatthews.jaxb2_commons/jaxb2-commons/ -->
<dependency>
    <groupId>com.btmatthews.jaxb2_commons</groupId>
    <artifactId>jaxb2-commons</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.btmatthews.jaxb2_commons/jaxb2-commons/
implementation 'com.btmatthews.jaxb2_commons:jaxb2-commons:1.0.0'
// https://jarcasting.com/artifacts/com.btmatthews.jaxb2_commons/jaxb2-commons/
implementation ("com.btmatthews.jaxb2_commons:jaxb2-commons:1.0.0")
'com.btmatthews.jaxb2_commons:jaxb2-commons:pom:1.0.0'
<dependency org="com.btmatthews.jaxb2_commons" name="jaxb2-commons" rev="1.0.0">
  <artifact name="jaxb2-commons" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.btmatthews.jaxb2_commons', module='jaxb2-commons', version='1.0.0')
)
libraryDependencies += "com.btmatthews.jaxb2_commons" % "jaxb2-commons" % "1.0.0"
[com.btmatthews.jaxb2_commons/jaxb2-commons "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • jaxb2-commons-lang3

JAXB2 Commons

Commons Lang3 Plugin

This is a port of the commons-lang for XJC that generates [toString()](http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html#toString(\)), [equals()](http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object\)), and [hashCode()](http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html#hashCode(\)) using Apache Commons Lang 3.

This plugin generates the following additional methods using ToStringBuilder, EqualsBuilder, and HashCodeBuilder:

@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}

@Override
public boolean equals(final Object that) {
    return EqualsBuilder.reflectionEquals(this, that);
}

@Override
public void int hashCode() {
    return HashCodeBuilder.reflectionHashCode(this);
}

Usage

Ant

The plugin can be used in an Ant build.xml project file using the following configuration:

<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
    <classpath>
        <pathelement path="/path/to/jaxb-xjc.jar"/>
        <pathelement path="/path/to/jaxb2-commons-lang3.jar" />
        <pathelement path="/path/to/commons-lang3.jar" />
    </classpath>
</taskdef>
<xjc>
    <arg value="-Xcommons-lang3" />
    <arg value="-Xcommons-lang3:ToStringStyle=SHORT_PREFIX_STYLE" />
    <!-- ... -->
</xjc>

Maven

The plugin can be used in a Maven pom.xml project file using the following configuration:

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb22-plugin</artifactId>
    <version>0.8.3</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <extension>true</extension>
                <args>
                    <arg>-Xcommons-lang3</arg>
                    <arg>-Xcommons-lang3:ToStringStyle=SHORT_PREFIX_STYLE</arg>
                </args>
                <plugins>
                    <plugin>
                        <groupId>com.btmatthews.jaxb2_commons</groupId>
                        <artifactId>jaxb2-commons-lang3</artifactId>
                        <version>1.0.0</version>
                    </plugin>
                </plugins>
            </configuration>
        </execution>
    </executions>
</plugin>

Versions

Version
1.0.0