|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.tools.xjc.Plugin
com.legstar.jaxb.plugin.CobolJAXBAnnotator
public class CobolJAXBAnnotator
This is an extension to the JAXB XJC plugin. It is being invoked by the JAXB XML to Java compilation and injects supplementary cobol annotations into the generated Java classes. Add -Dcom.sun.tools.xjc.Options.findServices=true to VM arguments to help solve classpath issues.
| Nested Class Summary | |
|---|---|
protected class |
CobolJAXBAnnotator.EciCompatibleNameConverter
This overrides the standard JAXB name converter when in ECI compatible mode. |
protected class |
CobolJAXBAnnotator.WinCompatibleNameConverter
Some file names are forbidden on Windows. |
| Field Summary | |
|---|---|
static String |
OPTION_NAME
Option passed to XJC to enable this cobol plugin. |
static String |
OPTION_USAGE
Command line help for cobol plugin XJC option. |
| Constructor Summary | |
|---|---|
CobolJAXBAnnotator()
|
|
| Method Summary | |
|---|---|
protected void |
annotateClass(com.sun.tools.xjc.outline.ClassOutline co)
Propagate xsd complex type annotations on a class type. |
List<String> |
getCustomizationURIs()
|
String |
getOptionName()
|
String |
getUsage()
|
boolean |
isCustomizationTagName(String nsUri,
String localName)
|
boolean |
isEciCompatible()
|
protected void |
mapAnnotations(com.sun.tools.xjc.model.CPluginCustomization c,
com.sun.codemodel.JAnnotationUse ce)
Each annotation is extracted from the XML schema customization and injected back into the JAXB class code. |
int |
parseArgument(com.sun.tools.xjc.Options opt,
String[] args,
int i)
. |
void |
postProcessModel(com.sun.tools.xjc.model.Model model,
ErrorHandler errorHandler)
XJC has built an abstract in-memory model of the target classes. |
boolean |
run(com.sun.tools.xjc.outline.Outline model,
com.sun.tools.xjc.Options opt,
ErrorHandler errorHandler)
This is where the real action takes place. |
protected void |
setBooleanParm(Element e,
String xmlMarkup,
com.sun.codemodel.JAnnotationUse ce)
Move an attribute value from the XML markup to the Cobol annotation. |
protected void |
setDefaultValue(com.sun.codemodel.JFieldVar jf,
Element e)
Attempts to set a default value for the java field based on the COBOL default value. |
protected void |
setNumericParm(Element e,
String xmlMarkup,
com.sun.codemodel.JAnnotationUse ce)
Move an attribute value from the XML markup to the Cobol annotation. |
protected void |
setStringParm(Element e,
String xmlMarkup,
com.sun.codemodel.JAnnotationUse ce)
Move an attribute value from the XML markup to the Cobol annotation. |
| Methods inherited from class com.sun.tools.xjc.Plugin |
|---|
onActivated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String OPTION_NAME
public static final String OPTION_USAGE
| Constructor Detail |
|---|
public CobolJAXBAnnotator()
| Method Detail |
|---|
public String getOptionName()
getOptionName in class com.sun.tools.xjc.Pluginpublic String getUsage()
getUsage in class com.sun.tools.xjc.Pluginpublic List<String> getCustomizationURIs()
getCustomizationURIs in class com.sun.tools.xjc.Plugin
public boolean isCustomizationTagName(String nsUri,
String localName)
isCustomizationTagName in class com.sun.tools.xjc.Plugin
public int parseArgument(com.sun.tools.xjc.Options opt,
String[] args,
int i)
throws com.sun.tools.xjc.BadCommandLineException,
IOException
parseArgument in class com.sun.tools.xjc.Plugincom.sun.tools.xjc.BadCommandLineException
IOException
public void postProcessModel(com.sun.tools.xjc.model.Model model,
ErrorHandler errorHandler)
XJC has built an abstract in-memory model of the target classes. We are given a chance to tweak it.
postProcessModel in class com.sun.tools.xjc.Plugin
public boolean run(com.sun.tools.xjc.outline.Outline model,
com.sun.tools.xjc.Options opt,
ErrorHandler errorHandler)
This is where the real action takes place. XJC has done its job of building an in-memory model of the soon-to-be generated java classes. We are given a chance to change that model so that the generated classes will include the extra annotations that we need.
run in class com.sun.tools.xjc.Plugin
protected void setDefaultValue(com.sun.codemodel.JFieldVar jf,
Element e)
jf - the java fielde - the XML node holding COBOL annotationsprotected void annotateClass(com.sun.tools.xjc.outline.ClassOutline co)
co - the class outline
protected void mapAnnotations(com.sun.tools.xjc.model.CPluginCustomization c,
com.sun.codemodel.JAnnotationUse ce)
c - the XML Schema annotation elementce - the Java code Cobol annotation
protected void setBooleanParm(Element e,
String xmlMarkup,
com.sun.codemodel.JAnnotationUse ce)
e - the Node holding the XML markupxmlMarkup - the name of the XML markup tagce - the target annotation recipient
protected void setNumericParm(Element e,
String xmlMarkup,
com.sun.codemodel.JAnnotationUse ce)
e - the Node holding the XML markupxmlMarkup - the name of the XML markup tagce - the target annotation recipient
protected void setStringParm(Element e,
String xmlMarkup,
com.sun.codemodel.JAnnotationUse ce)
e - the Node holding the XML markupxmlMarkup - the name of the XML markup tagce - the target annotation recipientpublic boolean isEciCompatible()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||