|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task com.legstar.coxb.gen.CoxbBindingGenerator
public class CoxbBindingGenerator
This class implements an ant task to generate COXB binding data from JAXB
cobol annotated instances. The generated binding code is faster than
alternative reflection methods also available in legstar-coxbrt
.
Another advantage of binding classes is that they can bind to a different
object than the original JAXB object which served to generate it.
Nested Class Summary | |
---|---|
static class |
CoxbBindingGenerator.JaxbRootClass
Represent a simple inner element for the ant task. |
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 | |
---|---|
CoxbBindingGenerator()
No args constructor. |
|
CoxbBindingGenerator(CoxbGenModel context)
Constructor from a set of options. |
Method Summary | |
---|---|
void |
addJaxbRootClass(String className)
Add a JAXB root class name holder object. |
void |
addUnmarshalChoiceStrategy(UnmarshalChoiceStrategy unmarshalChoiceStrategy)
Add a choice strategy to inject in generated bindings. |
protected void |
checkInput()
Checks that properties set are valid. |
CoxbBindingGenerator.JaxbRootClass |
createJaxbRootClass()
Creates a JAXB root class name holder object. |
static File |
createOutputFolder(CoxbGenModel coxbGenModel)
Create the folder which will receive the generated classes. |
void |
execute()
The ant method. |
String |
getAlternativeFactoryName()
Alternate factory to used rather than the JAXB one. |
String |
getAlternativePackageName()
Optional runtime alternative to the Jaxb package name used at generation time. |
String |
getCoxbPackageName()
The package name used for COXB classes. |
File |
getJaxbBinDir()
The location where JAXB classes live. |
File |
getJaxbDir()
Deprecated. Use getJaxbBinDir instead |
String |
getJaxbPackageName()
The package name used for JAXB classes. |
String |
getJaxbRootClassName()
This is an alternative to jaxbRootClassNames used when a single class is to be bound. |
List<String> |
getJaxbRootClassNames()
List of JAXB root class names to process. |
protected Object |
getObjectFactory(String packageName)
Loads the object factory class using the current class loader assuming the JAXB classes are available in the current classpath and returns a new instance of it. |
protected Object |
getRootObject(Object jaxbObjectFactory,
String rootObjectName)
Returns a new instance of the requested JAXB object. |
File |
getTargetDir()
The current target directory. |
List<UnmarshalChoiceStrategy> |
getUnmarshalChoiceStrategies()
Unmarshal choice strategies to inject in generated bindings. |
File |
getXsdFile()
The XML schema file. |
boolean |
isJsonTransformers()
True if Host to JSON transformers generation is turned on. |
boolean |
isXmlTransformers()
True if Host to XML transformers generation is turned on. |
void |
setAlternativeFactoryName(String targetFactoryName)
Alternate factory to used rather than the JAXB one. |
void |
setAlternativePackageName(String alternativePackageName)
Optional runtime alternative to the Jaxb package name used at generation time. |
void |
setCoxbPackageName(String coxbPackageName)
The package name used for COXB classes. |
void |
setJaxbBinDir(File jaxbBinDir)
The location where JAXB classes live. |
void |
setJaxbDir(File jaxbDir)
Deprecated. Use setJaxbBinDir instead |
void |
setJaxbPackageName(String jaxbPackageName)
The package name used for JAXB classes. |
void |
setJaxbRootClassName(String objectName)
A JAXB root class name to set. |
void |
setJsonTransformers(boolean jsonTransformers)
True if Host to JSON transformers generation is turned on. |
void |
setTargetDir(File targetDir)
The current target directory. |
void |
setUnmarshalChoiceStrategies(List<UnmarshalChoiceStrategy> _unmarshalChoiceStrategies)
Unmarshal choice strategies to inject in generated bindings. |
void |
setXmlTransformers(boolean xmlTransformers)
True if Host to XML transformers generation is turned on. |
void |
setXsdFile(File xsdFile)
The XML schema file. |
Methods inherited from class org.apache.tools.ant.Task |
---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, 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 CoxbBindingGenerator()
public CoxbBindingGenerator(CoxbGenModel context)
context
- options setMethod Detail |
---|
public void execute()
execute
in class org.apache.tools.ant.Task
protected void checkInput()
public static File createOutputFolder(CoxbGenModel coxbGenModel) throws CoxbGenException
coxbGenModel
- the generation model
CoxbGenException
- if generation folder cannot be determinedprotected Object getObjectFactory(String packageName)
packageName
- the package containing a JAXB Object Factory
protected Object getRootObject(Object jaxbObjectFactory, String rootObjectName)
jaxbObjectFactory
- an instance of a JAXB Object FactoryrootObjectName
- the JAXB root object name (non qualified)
public String getJaxbRootClassName()
public void setJaxbRootClassName(String objectName)
objectName
- The JAXB root class name to set.public File getXsdFile()
public void setXsdFile(File xsdFile)
xsdFile
- the XML schema file to setpublic File getTargetDir()
public void setTargetDir(File targetDir)
targetDir
- the target directory to setpublic File getJaxbDir()
getJaxbBinDir
instead
public void setJaxbDir(File jaxbDir)
setJaxbBinDir
instead
jaxbDir
- the JAXB location to setpublic File getJaxbBinDir()
public void setJaxbBinDir(File jaxbBinDir)
jaxbBinDir
- the JAXB location to setpublic String getJaxbPackageName()
public void setJaxbPackageName(String jaxbPackageName)
jaxbPackageName
- the JAXB classes package name to setpublic String getCoxbPackageName()
public void setCoxbPackageName(String coxbPackageName)
coxbPackageName
- package name for generated binding classes to setpublic boolean isXmlTransformers()
public void setXmlTransformers(boolean xmlTransformers)
xmlTransformers
- true if Host to XML transformers generation is
turned onpublic boolean isJsonTransformers()
public void setJsonTransformers(boolean jsonTransformers)
jsonTransformers
- true if Host to JSON transformers generation is
turned onpublic String getAlternativePackageName()
public void setAlternativePackageName(String alternativePackageName)
alternativePackageName
- the optional runtime alternative to the
Jaxb package name used at generation timepublic String getAlternativeFactoryName()
public void setAlternativeFactoryName(String targetFactoryName)
targetFactoryName
- the alternate factory to used rather than the
JAXB onepublic void addJaxbRootClass(String className)
className
- the class name to addpublic CoxbBindingGenerator.JaxbRootClass createJaxbRootClass()
public List<String> getJaxbRootClassNames()
public List<UnmarshalChoiceStrategy> getUnmarshalChoiceStrategies()
public void setUnmarshalChoiceStrategies(List<UnmarshalChoiceStrategy> _unmarshalChoiceStrategies)
_unmarshalChoiceStrategies
- the unmarshal choice strategies to
inject in generated bindings to setpublic void addUnmarshalChoiceStrategy(UnmarshalChoiceStrategy unmarshalChoiceStrategy)
unmarshalChoiceStrategy
- a choice strategy to inject in generated
bindings
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |