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 Summary
FieldsModifier and TypeFieldDescriptionprotected Classprotected Stringprotected booleanprotected booleanprotected Fileprotected Stringprotected Fileprotected org.jvnet.jaxb.plugin.elementwrapper.Instantiationprotected Classprotected final StringConstant for the option string.protected PrintWriterprotected Fileprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected static StringelementName(com.sun.tools.xjc.model.CPropertyInfo property) findCandidateClasses(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler) protected StringfirstUpper(String s) protected StringgetIncludeOrExcludeReason(org.jvnet.jaxb.plugin.elementwrapper.Candidate candidate) getUsage()protected booleanprotected booleanprotected booleanisIncluded(org.jvnet.jaxb.plugin.elementwrapper.Candidate candidate) voidonActivated(com.sun.tools.xjc.Options opts) intparseArgument(com.sun.tools.xjc.Options opt, String[] args, int i) voidpostProcessModel(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler) protected voidreadCandidates(File file, Set<String> candidates) booleanrun(com.sun.tools.xjc.outline.Outline model, com.sun.tools.xjc.Options opt, ErrorHandler errorHandler) protected voidwriteDebug(String s) protected voidMethods inherited from class com.sun.tools.xjc.Plugin
getCustomizationURIs, isCustomizationTagName
-
Field Details
-
OPTION_NAME
Constant for the option string.- See Also:
-
candidates
-
includeFile
-
include
-
excludeFile
-
exclude
-
summaryFile
-
summary
-
debugMode
protected boolean debugMode -
verbose
protected boolean verbose -
interfaceClass
-
collectionClass
-
instantiation
protected org.jvnet.jaxb.plugin.elementwrapper.Instantiation instantiation -
deleteCandidates
protected boolean deleteCandidates -
factoryClassName
-
debugClassName
-
-
Constructor Details
-
XmlElementWrapperPlugin
public XmlElementWrapperPlugin()
-
-
Method Details
-
getOptionName
- Specified by:
getOptionNamein classcom.sun.tools.xjc.Plugin
-
getUsage
- Specified by:
getUsagein classcom.sun.tools.xjc.Plugin
-
onActivated
public void onActivated(com.sun.tools.xjc.Options opts) throws com.sun.tools.xjc.BadCommandLineException - Overrides:
onActivatedin classcom.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:
parseArgumentin classcom.sun.tools.xjc.Plugin- Throws:
com.sun.tools.xjc.BadCommandLineExceptionIOException
-
postProcessModel
- Overrides:
postProcessModelin classcom.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:
runin classcom.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
- Throws:
IOException
-
firstUpper
-
findCandidateClasses
protected Map<String,org.jvnet.jaxb.plugin.elementwrapper.Candidate> findCandidateClasses(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler) -
writeSummary
-
closeSummary
- Throws:
IOException
-
writeDebug
-
elementName
-