Class XjcCommonsLangPlugin

java.lang.Object
com.sun.tools.xjc.Plugin
org.jvnet.jaxb.plugin.commons_lang.XjcCommonsLangPlugin

public class XjcCommonsLangPlugin extends com.sun.tools.xjc.Plugin
Automatically generates the toString(), hashCode() and equals() methods using Jakarta's commons-lang. Supports the optional ToStringStyle command line parameter to specify the style for use within the toString method.
 Example 1:

     -Xcommons-lang
     -Xcommons-lang:ToStringStyle=SIMPLE_STYLE

     to specify the use of

     org.apache.commons.lang3.builder.ToStringStyle.SIMPLE_STYLE

 Example 2:

     -Xcommons-lang
     -Xcommons-lang:ToStringStyle=my.CustomToStringStyle

     to specify the use of

     my.CustomToStringStyle, which must be a subclass of

     org.apache.commons.lang3.builder.ToStringStyle, and contains a public no-arg constructor.

 
The default ToStringStyle adopted by this plugin is MULTI_LINE_STYLE.
Author:
Hanson Char
  • Constructor Details

    • XjcCommonsLangPlugin

      public XjcCommonsLangPlugin()
  • Method Details

    • getOptionName

      public String getOptionName()
      Specified by:
      getOptionName in class com.sun.tools.xjc.Plugin
    • getUsage

      public String getUsage()
      Specified by:
      getUsage in class com.sun.tools.xjc.Plugin
    • run

      public boolean run(com.sun.tools.xjc.outline.Outline outline, com.sun.tools.xjc.Options opt, ErrorHandler errorHandler)
      Specified by:
      run in class com.sun.tools.xjc.Plugin
    • parseArgument

      public int parseArgument(com.sun.tools.xjc.Options opt, String[] args, int i) throws com.sun.tools.xjc.BadCommandLineException
      Overrides:
      parseArgument in class com.sun.tools.xjc.Plugin
      Throws:
      com.sun.tools.xjc.BadCommandLineException