Package org.eclipse.m2m.atl.core.ant.tasks

## Class AbstractAtlTask

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.Task
    - - org.eclipse.m2m.atl.core.ant.tasks.AbstractAtlTask

All Implemented Interfaces:
  `java.lang.Cloneable`

Direct Known Subclasses:
  `ATLModelTransformationTask`, `LoadModelTask`, `SaveModelTask`

    public class AbstractAtlTask
    extends org.apache.tools.ant.Task

Common ATL task:

- handle atl log.
- provide utility methods.
- handle finalization (dispose of models).

### Field Summary

Fields
`static java.lang.String` `DEFAULT_LAUNCHER` Default launcher name.
`static java.lang.String` `DEFAULT_MODEL_HANDLER` Default model handler name.
`static java.lang.String` `LAUNCHER_PROPERTY` The launcher property name.
`static java.lang.String` `OPTION_MODEL_HANDLER` The model handler name.
`static java.lang.String` `OPTION_MODEL_NAME` The model name.
`static java.lang.String` `OPTION_MODEL_PATH` The model path.
`static java.lang.String` `OPTION_NEW_MODEL` The newModel boolean.
`static java.lang.String` `RESULT_REFERENCE` The result reference name.

### 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

Constructors
`AbstractAtlTask()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `error​(java.lang.String msg)` Stops the build, deletes log.
`protected void` `error​(java.lang.String msg, java.lang.Throwable e)` Stops the build, deletes log.
`void` `execute()`
`protected ModelFactory` `getDefaultModelFactory()` Returns the default modelFactory for this launcher.
`protected ILauncher` `getLauncher()` Returns the launcher.
`protected java.lang.String` `getLauncherName()` Returns the launcher name.
`void` `init()`
`protected IModel` `newModel​(java.lang.String factoryName, java.lang.String modelName, java.lang.String referenceModelName, java.util.Map<java.lang.String,​java.lang.Object> options)` Creates a new `IModel` using the specified factory.
`protected IModel` `newModel​(ModelFactory factory, java.lang.String modelName, java.lang.String referenceModelName, java.util.Map<java.lang.String,​java.lang.Object> options)` Creates a new `IModel` using the specified factory.
`protected IReferenceModel` `newReferenceModel​(ModelFactory factory, java.lang.String modelName, java.util.Map<java.lang.String,​java.lang.Object> options)` Creates a new `IReferenceModel` using the specified factory.

### Methods inherited from class org.apache.tools.ant.Task

`bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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

#### LAUNCHER_PROPERTY

    public static final java.lang.String LAUNCHER_PROPERTY

The launcher property name.

See Also:
  Constant Field Values

#### DEFAULT_LAUNCHER

    public static final java.lang.String DEFAULT_LAUNCHER

Default launcher name.

See Also:
  Constant Field Values

#### RESULT_REFERENCE

    public static final java.lang.String RESULT_REFERENCE

The result reference name.

See Also:
  Constant Field Values

#### DEFAULT_MODEL_HANDLER

    public static final java.lang.String DEFAULT_MODEL_HANDLER

Default model handler name.

See Also:
  Constant Field Values

#### OPTION_MODEL_HANDLER

    public static final java.lang.String OPTION_MODEL_HANDLER

The model handler name.

See Also:
  Constant Field Values

#### OPTION_MODEL_NAME

    public static final java.lang.String OPTION_MODEL_NAME

The model name.

See Also:
  Constant Field Values

#### OPTION_MODEL_PATH

    public static final java.lang.String OPTION_MODEL_PATH

The model path.

See Also:
  Constant Field Values

#### OPTION_NEW_MODEL

    public static final java.lang.String OPTION_NEW_MODEL

The newModel boolean.

See Also:
  Constant Field Values

### Constructor Detail

#### AbstractAtlTask

    public AbstractAtlTask()

### Method Detail

#### init

    public void init()
              throws org.apache.tools.ant.BuildException

Overrides:
  `init` in class `org.apache.tools.ant.Task`
Throws:
  `org.apache.tools.ant.BuildException`
See Also:
  `Task.init()`

#### execute

    public void execute()
                 throws org.apache.tools.ant.BuildException

Overrides:
  `execute` in class `org.apache.tools.ant.Task`
Throws:
  `org.apache.tools.ant.BuildException`
See Also:
  `Task.execute()`

#### error

    protected void error​(java.lang.String msg,
                         java.lang.Throwable e)

Stops the build, deletes log.

Parameters:
  `msg` - the error message
  `e` - the thrown exception

#### error

    protected void error​(java.lang.String msg)

Stops the build, deletes log.

Parameters:
  `msg` - the error message

#### getLauncherName

    protected java.lang.String getLauncherName()

Returns the launcher name.

Returns:
  the launcher name

#### getLauncher

    protected ILauncher getLauncher()

Returns the launcher.

Returns:
  the launcher

#### getDefaultModelFactory

    protected ModelFactory getDefaultModelFactory()

Returns the default modelFactory for this launcher.

Returns:
  the default modelFactory for this launcher

#### newModel

    protected IModel newModel​(java.lang.String factoryName,
                              java.lang.String modelName,
                              java.lang.String referenceModelName,
                              java.util.Map<java.lang.String,​java.lang.Object> options)
                       throws org.apache.tools.ant.BuildException

Creates a new `IModel` using the specified factory.

Parameters:
  `factoryName` - the `ModelFactory` name
  `modelName` - the model name
  `referenceModelName` - the reference model name
  `options` - the creation options
Returns:
  the new `IModel`
Throws:
  `org.apache.tools.ant.BuildException`

#### newModel

    protected IModel newModel​(ModelFactory factory,
                              java.lang.String modelName,
                              java.lang.String referenceModelName,
                              java.util.Map<java.lang.String,​java.lang.Object> options)
                       throws org.apache.tools.ant.BuildException

Creates a new `IModel` using the specified factory.

Parameters:
  `factory` - the `ModelFactory`
  `modelName` - the model name
  `referenceModelName` - the reference model name
  `options` - the creation options
Returns:
  the new `IModel`
Throws:
  `org.apache.tools.ant.BuildException`

#### newReferenceModel

    protected IReferenceModel newReferenceModel​(ModelFactory factory,
                                                java.lang.String modelName,
                                                java.util.Map<java.lang.String,​java.lang.Object> options)
                                         throws org.apache.tools.ant.BuildException

Creates a new `IReferenceModel` using the specified factory.

Parameters:
  `factory` - the `ModelFactory`
  `modelName` - the model name
  `options` - the creation options
Returns:
  the new `IReferenceModel`
Throws:
  `org.apache.tools.ant.BuildException`