org.eclipse.xsd.ecore.importer.taskdefs
Class XSDGeneratorTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.eclipse.emf.ant.taskdefs.EMFTask
org.eclipse.emf.ant.taskdefs.codegen.ecore.GeneratorTask
org.eclipse.xsd.ecore.importer.taskdefs.XSDGeneratorTask
- public class XSDGeneratorTask
- extends GeneratorTask
Generates source code from models specifed in XML Schema files. Exposes some
functionalities available on the XSD2GenModel
class - check its printUsage() method for detailed information on the arguments
you can use with this task.
This task is supposed to be executed by a Eclipse driver with the
org.eclipse.emf.ant plugin. It is neither necessary to use Ant's task
TaskDef to declare this task in a script nor to change the Ant's runtime
classpath.
The following command line will start a headless Eclipse instance and run the specified
Ant script.
java -classpath eclipseDir/startup.jar org.eclipse.core.launcher.Main
-data worspaceDir
-application org.eclipse.ant.core.antRunner
-buildfile antScript
Usage example:
<emf.XSD2Java model="c:/lib/model/lib.xsd"
genModel="c:/lib/emf/lib.genmodel"
modelProject="c:/lib"
modelProjectFragmentPath="src"
modelPluginID="emf.lib.example">
<arg line="-packages http://www.example.eclipse.org/Library"/>
</emf.XSD2Java>
<emf.XSD2Java genModel="c:/lib/emf/lib.genmodel"
modelProject="c:/lib"
modelProjectFragmentPath="src">
<arg line="-packages http://www.example.eclipse.org/Library"/>
<model uri="http://www.example.eclipse.org/library.xsd"/>
<model file="c:/common.xsd"/>
</emf.XSD2Java>
- Since:
- 2.1.0
| 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 |
| Methods inherited from class org.eclipse.emf.ant.taskdefs.codegen.ecore.GeneratorTask |
adjustEditAndEditorProjects, createArg, doExecute, generateCodeFromGenModel, getCommandline, getGeneratorArguments, setCopyright, setGenerateEditorProject, setGenerateEditProject, setGenerateJavaCode, setGenerateModelProject, setGenModel, setModel, setModelPluginID, setModelProject, setModelProjectFragmentPath, setReconcileGenModel, setReconcileGenModel, setSDO, setTemplatePath |
| 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 |
XSDGeneratorTask
public XSDGeneratorTask()
createModel
public XSDGeneratorTask.Model createModel()
checkAttributes
protected void checkAttributes()
throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
addGenModelArguments
protected void addGenModelArguments()
createGenModel
protected void createGenModel(String[] arguments)
throws Exception
- Throws:
Exception