public class JETEmitterTask extends JETTask
Exposes some functionalities available on the
JETEmitter
class.
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 examples:
<emf.JETEmitter templateURI="http://www.example.com/jetTemplate.txtjet" newFile="c:\output.txt"/>
<emf.JETEmitter templateFile="jetTemplate.txtjet" newFile="c:\output.txt"/>
<emf.JETEmitter templateURI="d:\templates\jetTemplate.txtjet" newFile="c:\output.txt"> <variable name="MY_VAR" pluginID="com.myplugin;/> <variable name="JUNIT_HOME" pluginID="org.eclipse.jdt.junit;/> </emf.JETEmitter>
Modifier and Type | Class and Description |
---|---|
static class |
JETEmitterTask.Variable |
newFile, templateFile, templateURI
Constructor and Description |
---|
JETEmitterTask() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAttributes()
All the attribute checks should be performed in this method.
|
protected JETEmitter |
createJETEmitter() |
JETEmitterTask.Variable |
createVariable() |
protected void |
doExecute()
Performs the task specific code.
|
protected void |
invokeEmitter(JETEmitter emitter) |
void |
setArgument(java.lang.Object argument) |
void |
setArgumentClass(java.lang.Class<?> argumentClass) |
void |
setProject(java.lang.String project) |
getTemplateURIAsString, setNewFile, setTemplateFile, setTemplateURI
assertTrue, execute, getProgressMonitor
public void setProject(java.lang.String project)
public JETEmitterTask.Variable createVariable()
public void setArgument(java.lang.Object argument)
public void setArgumentClass(java.lang.Class<?> argumentClass)
protected void checkAttributes() throws BuildException
EMFTask
checkAttributes
in class JETTask
BuildException
protected void doExecute() throws java.lang.Exception
EMFTask
protected JETEmitter createJETEmitter() throws JETException
JETException
protected void invokeEmitter(JETEmitter emitter) throws JETException, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException
JETException
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException