Class 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 Detail

      • candidates

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

        protected File includeFile
      • excludeFile

        protected File excludeFile
      • summaryFile

        protected File summaryFile
      • 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 Detail

      • XmlElementWrapperPlugin

        public XmlElementWrapperPlugin()
    • Method Detail

      • 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()
      • 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)
      • writeDebug

        protected void writeDebug​(String s)
      • elementName

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