org.eclipse.xsd.ecore.importer.taskdefs
Class XSDGeneratorTask

java.lang.Object
  extended by GeneratorTask
      extended by org.eclipse.xsd.ecore.importer.taskdefs.XSDGeneratorTask

public class XSDGeneratorTask
extends GeneratorTask

Generates source code from models specified in XML Schema files. Exposes some functionalities available on the XSDImporterApplication 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.

eclipseDir/eclipse -noSplash -data worspaceDir -application org.eclipse.ant.core.antRunner -buildfile antScript

In Windows you should execute eclipsec instead of eclipse in order to have access to the Ant build script console output.

You can also use the Eclipse UI to execute an Ant script containing this task by right-clicking the script and selecting Run As > Ant Build... > JRE > "Run in the same JRE as the workspace".

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

Constructor Summary
XSDGeneratorTask()
           
 
Method Summary
protected  void createGenModel(java.lang.String[] arguments)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSDGeneratorTask

public XSDGeneratorTask()
Method Detail

createGenModel

protected void createGenModel(java.lang.String[] arguments)
                       throws java.lang.Exception
Throws:
java.lang.Exception

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.