Class XmlElementWrapperPlugin
- java.lang.Object
-
- com.sun.tools.xjc.Plugin
-
- org.jvnet.jaxb.plugin.elementwrapper.XmlElementWrapperPlugin
-
public class XmlElementWrapperPlugin extends com.sun.tools.xjc.PluginWhen 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
Fields Modifier and Type Field Description protected Map<String,org.jvnet.jaxb.plugin.elementwrapper.Candidate>candidatesprotected ClasscollectionClassprotected StringdebugClassNameprotected booleandebugModeprotected booleandeleteCandidatesprotected Set<String>excludeprotected FileexcludeFileprotected StringfactoryClassNameprotected Set<String>includeprotected FileincludeFileprotected org.jvnet.jaxb.plugin.elementwrapper.Instantiationinstantiationprotected ClassinterfaceClassprotected StringOPTION_NAMEConstant for the option string.protected PrintWritersummaryprotected FilesummaryFileprotected booleanverbose
-
Constructor Summary
Constructors Constructor Description XmlElementWrapperPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseSummary()protected static StringelementName(com.sun.tools.xjc.model.CPropertyInfo property)protected Map<String,org.jvnet.jaxb.plugin.elementwrapper.Candidate>findCandidateClasses(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler)protected StringfirstUpper(String s)protected StringgetIncludeOrExcludeReason(org.jvnet.jaxb.plugin.elementwrapper.Candidate candidate)StringgetOptionName()StringgetUsage()protected booleanhasExcludes()protected booleanhasIncludes()protected 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 voidwriteSummary(String s)
-
-
-
Field Detail
-
OPTION_NAME
protected final String OPTION_NAME
Constant for the option string.- See Also:
- Constant Field Values
-
includeFile
protected File includeFile
-
excludeFile
protected File excludeFile
-
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
-
-
Method Detail
-
getOptionName
public String getOptionName()
- Specified by:
getOptionNamein classcom.sun.tools.xjc.Plugin
-
getUsage
public String 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
public void postProcessModel(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler)- 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
protected void readCandidates(File file, Set<String> candidates) throws IOException
- Throws:
IOException
-
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)
-
-