Class XmlElementWrapperPlugin

java.lang.Object
com.sun.tools.xjc.Plugin
org.jvnet.jaxb.plugin.elementwrapper.XmlElementWrapperPlugin

public class XmlElementWrapperPlugin extends com.sun.tools.xjc.Plugin
When generating XML schema from Java source code using the schemagen tool a common approach is to use the @XmlElementWrapper and @XmlElement annotations to handle schema generation for collections. However, when generating Java source from a schema using the xjc tool the resulting code is not created with these annotations. Instead, the generated Java source contains "injected" inner classes to accommodate the collection of elements contained within an element. This plugin came from here : org.andromda.thirdparty.jaxb2_commons:xml-element-wrapper:1.0
  • Field Details

    • OPTION_NAME

      protected final String OPTION_NAME
      Constant for the option string.
      See Also:
    • candidates

      protected Map<String,org.jvnet.jaxb.plugin.elementwrapper.Candidate> candidates
    • includeFile

      protected File includeFile
    • include

      protected Set<String> include
    • excludeFile

      protected File excludeFile
    • exclude

      protected Set<String> exclude
    • summaryFile

      protected File summaryFile
    • summary

      protected PrintWriter summary
    • debugMode

      protected boolean debugMode
    • verbose

      protected boolean verbose
    • interfaceClass

      protected Class interfaceClass
    • collectionClass

      protected Class collectionClass
    • instantiation

      protected org.jvnet.jaxb.plugin.elementwrapper.Instantiation instantiation
    • deleteCandidates

      protected boolean deleteCandidates
    • factoryClassName

      protected String factoryClassName
    • debugClassName

      protected String debugClassName
  • Constructor Details

    • XmlElementWrapperPlugin

      public XmlElementWrapperPlugin()
  • 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
    • onActivated

      public void onActivated(com.sun.tools.xjc.Options opts) throws com.sun.tools.xjc.BadCommandLineException
      Overrides:
      onActivated in class com.sun.tools.xjc.Plugin
      Throws:
      com.sun.tools.xjc.BadCommandLineException
    • parseArgument

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

      public void postProcessModel(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler)
      Overrides:
      postProcessModel in class com.sun.tools.xjc.Plugin
    • run

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

      protected boolean isIncluded(org.jvnet.jaxb.plugin.elementwrapper.Candidate candidate)
    • getIncludeOrExcludeReason

      protected String getIncludeOrExcludeReason(org.jvnet.jaxb.plugin.elementwrapper.Candidate candidate)
    • hasIncludes

      protected boolean hasIncludes()
    • hasExcludes

      protected boolean hasExcludes()
    • readCandidates

      protected void readCandidates(File file, Set<String> candidates) throws IOException
      Throws:
      IOException
    • firstUpper

      protected String firstUpper(String s)
    • findCandidateClasses

      protected Map<String,org.jvnet.jaxb.plugin.elementwrapper.Candidate> findCandidateClasses(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler)
    • writeSummary

      protected void writeSummary(String s)
    • closeSummary

      protected void closeSummary() throws IOException
      Throws:
      IOException
    • writeDebug

      protected void writeDebug(String s)
    • elementName

      protected static String elementName(com.sun.tools.xjc.model.CPropertyInfo property)