## org.eclipse.emf.ant.taskdefs.codegen
Class JETCompilerTask

    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.JETTask
                      org.eclipse.emf.ant.taskdefs.codegen.JETCompilerTask

All Implemented Interfaces:
  java.lang.Cloneable

    public class JETCompilerTask

extends JETTask

Exposes some functionalities available on the `JETCompiler` 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.JETCompiler templateURI="http://www.example.com/jetTemplate.javajet"/>

     <emf.JETCompiler templateFile="jetTemplate.javajet"/>

     <emf.JETCompiler templateURI="d:\templates\jetTemplate.txtjet"
                     newFile="c:\output.txt"/>

Since:
  2.3.0

Field Summary
`protected static java.lang.String` `DEFAULT_EXTENSION`
`protected java.lang.String` `encoding`
`protected java.io.File` `sourceDirectory`

Fields inherited from class org.eclipse.emf.ant.taskdefs.codegen.JETTask
`newFile, templateFile, templateURI`

Fields inherited from class org.apache.tools.ant.Task
`target, taskName, taskType, wrapper`

Fields inherited from class org.apache.tools.ant.ProjectComponent
`description, location, project`

Constructor Summary
`JETCompilerTask()`

Method Summary
`protected void` `checkAttributes()` All the attribute checks should be performed in this method.
`protected JETCompiler` `createJETCompiler()`
`protected void` `doExecute()` Performs the task specific code.
`protected void` `invokeCompiler(JETCompiler compiler)`
`void` `setEncoding(java.lang.String encoding)`
`void` `setSourceDirectory(java.io.File sourceDirectory)`

Methods inherited from class org.eclipse.emf.ant.taskdefs.codegen.JETTask
`getTemplateURIAsString, setNewFile, setTemplateFile, setTemplateURI`

Methods inherited from class org.eclipse.emf.ant.taskdefs.EMFTask
`assertTrue, execute, getProgressMonitor`

Methods inherited from class org.apache.tools.ant.Task
`bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`

Methods inherited from class org.apache.tools.ant.ProjectComponent
`clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_EXTENSION

    protected static final java.lang.String DEFAULT_EXTENSION

See Also:
  Constant Field Values

### encoding

    protected java.lang.String encoding

### sourceDirectory

    protected java.io.File sourceDirectory

Constructor Detail

### JETCompilerTask

    public JETCompilerTask()

Method Detail

### setSourceDirectory

    public void setSourceDirectory(java.io.File sourceDirectory)

### setEncoding

    public void setEncoding(java.lang.String encoding)

### 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 `JETTask`
  Throws:
    `org.apache.tools.ant.BuildException`

### doExecute

    protected void doExecute()
                      throws java.lang.Exception

  Description copied from class: `EMFTask`
  Performs the task specific code.

  Specified by:
    `doExecute` in class `EMFTask`
  Throws:
    `java.lang.Exception`

### createJETCompiler

    protected JETCompiler createJETCompiler()
                                     throws JETException

  Throws:
    `JETException`

### invokeCompiler

    protected void invokeCompiler(JETCompiler compiler)
                           throws JETException,
                                  java.io.IOException,
                                  java.lang.InstantiationException,
                                  java.lang.IllegalAccessException

  Throws:
    `JETException`
    `java.io.IOException`
    `java.lang.InstantiationException`
    `java.lang.IllegalAccessException`

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