|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.legstar.jaxb.gen.CobolJAXBGenerator
public class CobolJAXBGenerator
A lightweight ant Task which augments the standard JAXB XJC Task.
The basic idea is to collect customization parameters and generate a temporary JAXB external customization file. This is not a replacement for XJC, just a more restricted way of using it for legstar to relieve upfront modules, such as cob2xsd, from adding JAXB customizations to the XML SChema.
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
description, location, target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
project |
| Constructor Summary | |
|---|---|
CobolJAXBGenerator()
No args constructor. |
|
CobolJAXBGenerator(JaxbGenModel context)
Constructor from a set of options. |
|
| Method Summary | |
|---|---|
protected void |
checkInput()
Checks that properties set are valid. |
String |
createExternalCustomization(File xsdFile)
Creates a temporary binding file holding the parameters chosen. |
protected File |
createInternalCustomization(File xsdFile)
Creates a temporary XML Schema which holds JAXB customization bindings. |
void |
execute()
The ant method. |
String |
getElementNamePrefix()
The prefix to add to element names. |
String |
getElementNameSuffix()
The suffix to add to element names. |
String |
getJaxbPackageName()
If specified, generated code will be placed under this Java package. |
long |
getSerializableUid()
The serialization unique ID. |
File |
getTargetDir()
Generated code will be written under this directory. |
String |
getTypeNamePrefix()
The prefix to add to type names. |
String |
getTypeNameSuffix()
The suffix to add to type names. |
File |
getXsdFile()
This is the schema file to be compiled. |
void |
init()
Initialize a commons logging logger so that XJC logs gets merged with the legstar ones. |
boolean |
isEciCompatible()
Whether the ECI naming conventions should be used. |
boolean |
isGenerateIsSetMethod()
If IsSet Methods should be generated. |
boolean |
isInternalBindings()
whether internal bindings or and external binding should be used. |
boolean |
isNoPackageInfo()
Prevents generation of JAXB package-info.java which does not compile under JDK 1.5. |
void |
setEciCompatible(boolean eciCompatible)
Whether the ECI naming conventions should be used. |
void |
setElementNamePrefix(String elementNamePrefix)
The prefix to add to element names. |
void |
setElementNameSuffix(String elementNameSuffix)
The suffix to add to element names. |
void |
setGenerateIsSetMethod(boolean generateIsSetMethod)
If IsSet Methods should be generated. |
void |
setInternalBindings(boolean internalBindings)
Whether internal bindings or and external binding should be used. |
void |
setJaxbPackageName(String jaxbPackageName)
If specified, generated code will be placed under this Java package. |
void |
setNoPackageInfo(boolean noPackageInfo)
Prevents generation of JAXB package-info.java which does not compile under JDK 1.5. |
void |
setSerializableUid(long serializableUid)
The serialization unique ID. |
void |
setTargetDir(File targetDir)
Generated code will be written under this directory. |
void |
setTypeNamePrefix(String typeNamePrefix)
The prefix to add to type names. |
void |
setTypeNameSuffix(String typeNameSuffix)
The suffix to add to type names. |
void |
setXsdFile(File xsdFile)
This is the schema file to be compiled. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getProject, setProject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CobolJAXBGenerator()
public CobolJAXBGenerator(JaxbGenModel context)
context - options set| Method Detail |
|---|
public void init()
init in class org.apache.tools.ant.TaskTask.init()public void execute()
execute in class org.apache.tools.ant.Taskprotected void checkInput()
protected File createInternalCustomization(File xsdFile)
xsdFile - the original XML schema file
public String createExternalCustomization(File xsdFile)
xsdFile - the XML Schema location
public File getXsdFile()
public void setXsdFile(File xsdFile)
xsdFile - schema filepublic String getJaxbPackageName()
public void setJaxbPackageName(String jaxbPackageName)
jaxbPackageName - Java package namepublic File getTargetDir()
public void setTargetDir(File targetDir)
targetDir - destination directorypublic boolean isGenerateIsSetMethod()
public void setGenerateIsSetMethod(boolean generateIsSetMethod)
generateIsSetMethod - if IsSet Methods should be generatedpublic long getSerializableUid()
public void setSerializableUid(long serializableUid)
serializableUid - the serialization unique ID. (All JAXB classes
must be serializable for LegStar)public String getTypeNamePrefix()
public void setTypeNamePrefix(String typeNamePrefix)
typeNamePrefix - the prefix to add to type namespublic String getTypeNameSuffix()
public void setTypeNameSuffix(String typeNameSuffix)
typeNameSuffix - the suffix to add to type namespublic String getElementNamePrefix()
public void setElementNamePrefix(String elementNamePrefix)
elementNamePrefix - the prefix to add to element namespublic String getElementNameSuffix()
public void setElementNameSuffix(String elementNameSuffix)
elementNameSuffix - the suffix to add to element namespublic boolean isInternalBindings()
public void setInternalBindings(boolean internalBindings)
internalBindings - whether internal bindings or and external binding
should be usedpublic boolean isEciCompatible()
public void setEciCompatible(boolean eciCompatible)
eciCompatible - whether the ECI naming conventions should be usedpublic boolean isNoPackageInfo()
public void setNoPackageInfo(boolean noPackageInfo)
noPackageInfo - true if we should not generate package-info.java
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||