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:
  `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
Modifier and Type
Field
Description
`static final String`
`DEFAULT_LAUNCHER`
Default launcher name.
`static final String`
`DEFAULT_MODEL_HANDLER`
Default model handler name.
`static final String`
`LAUNCHER_PROPERTY`
The launcher property name.
`static final String`
`OPTION_MODEL_HANDLER`
The model handler name.
`static final String`
`OPTION_MODEL_NAME`
The model name.
`static final String`
`OPTION_MODEL_PATH`
The model path.
`static final String`
`OPTION_NEW_MODEL`
The newModel boolean.
`static final 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
Constructor
Description
`AbstractAtlTask()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`error(String msg)`
Stops the build, deletes log.
`protected void`
`error(String msg, 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 String`
`getLauncherName()`
Returns the launcher name.
`void`
`init()`
`protected IModel`
`newModel(String factoryName, String modelName, String referenceModelName, Map<String,Object> options)`
Creates a new `IModel` using the specified factory.
`protected IModel`
`newModel(ModelFactory factory, String modelName, String referenceModelName, Map<String,Object> options)`
Creates a new `IModel` using the specified factory.
`protected IReferenceModel`
`newReferenceModel(ModelFactory factory, String modelName, Map<String,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 Details

### LAUNCHER_PROPERTY

public static final String LAUNCHER_PROPERTY
The launcher property name.

See Also:
  - Constant Field Values

### DEFAULT_LAUNCHER

public static final String DEFAULT_LAUNCHER
Default launcher name.

See Also:
  - Constant Field Values

### RESULT_REFERENCE

public static final String RESULT_REFERENCE
The result reference name.

See Also:
  - Constant Field Values

### DEFAULT_MODEL_HANDLER

public static final String DEFAULT_MODEL_HANDLER
Default model handler name.

See Also:
  - Constant Field Values

### OPTION_MODEL_HANDLER

public static final String OPTION_MODEL_HANDLER
The model handler name.

See Also:
  - Constant Field Values

### OPTION_MODEL_NAME

public static final String OPTION_MODEL_NAME
The model name.

See Also:
  - Constant Field Values

### OPTION_MODEL_PATH

public static final String OPTION_MODEL_PATH
The model path.

See Also:
  - Constant Field Values

### OPTION_NEW_MODEL

public static final String OPTION_NEW_MODEL
The newModel boolean.

See Also:
  - Constant Field Values

## Constructor Details

### AbstractAtlTask

public AbstractAtlTask()

## Method Details

### 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(String msg, Throwable e)
Stops the build, deletes log.

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

### error

protected void error(String msg)
Stops the build, deletes log.

Parameters:
  `msg` - the error message

### getLauncherName

protected 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(String factoryName, String modelName, String referenceModelName, Map<String,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, String modelName, String referenceModelName, Map<String,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, String modelName, Map<String,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`