org.eclipse.emf.ant.taskdefs.codegen
Class JETEmitterTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.eclipse.emf.ant.taskdefs.EMFTask
              extended byorg.eclipse.emf.ant.taskdefs.codegen.JETEmitterTask

public class JETEmitterTask
extends EMFTask

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.

java -classpath eclipseDir/startup.jar org.eclipse.core.launcher.Main -data worspaceDir -application org.eclipse.ant.core.antRunner -buildfile antScript

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>
 

Since:
2.1.0

Nested Class Summary
static class JETEmitterTask.Variable
           
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Constructor Summary
JETEmitterTask()
           
 
Method Summary
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  String getTemplateURIAsString()
           
protected  void invokeEmitter(JETEmitter emitter)
           
 void setArgument(Object argument)
           
 void setArgumentClass(Class argumentClass)
           
 void setNewFile(File newFile)
           
 void setProject(String project)
           
 void setTemplateFile(File templateFile)
           
 void setTemplateURI(String templateURI)
           
 
Methods inherited from class org.eclipse.emf.ant.taskdefs.EMFTask
assertTrue, execute, getProgressMonitor
 
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

JETEmitterTask

public JETEmitterTask()
Method Detail

setTemplateFile

public void setTemplateFile(File templateFile)

setTemplateURI

public void setTemplateURI(String templateURI)

setNewFile

public void setNewFile(File newFile)

setProject

public void setProject(String project)

createVariable

public JETEmitterTask.Variable createVariable()

setArgument

public void setArgument(Object argument)

setArgumentClass

public void setArgumentClass(Class argumentClass)

getTemplateURIAsString

protected String getTemplateURIAsString()

checkAttributes

protected void checkAttributes()
                        throws org.apache.tools.ant.BuildException
Description copied from class: EMFTask
All the attribute checks should be performed in this method.

Overrides:
checkAttributes in class EMFTask
Throws:
org.apache.tools.ant.BuildException

doExecute

protected void doExecute()
                  throws Exception
Description copied from class: EMFTask
Performs the task specific code.

Specified by:
doExecute in class EMFTask
Throws:
Exception

createJETEmitter

protected JETEmitter createJETEmitter()
                               throws JETException
Throws:
JETException

invokeEmitter

protected void invokeEmitter(JETEmitter emitter)
                      throws JETException,
                             IOException,
                             InstantiationException,
                             IllegalAccessException
Throws:
JETException
IOException
InstantiationException
IllegalAccessException

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