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 Modifier and Type Field Description 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.
-
Constructor Summary
Constructors Constructor Description AbstractAtlTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 newIModel
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 newIModel
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 newIReferenceModel
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
-
-
-
-
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
-
-
Method Detail
-
init
public void init() throws org.apache.tools.ant.BuildException
- Overrides:
init
in classorg.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 classorg.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 messagee
- 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 newIModel
using the specified factory.- Parameters:
factoryName
- theModelFactory
namemodelName
- the model namereferenceModelName
- the reference model nameoptions
- 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 newIModel
using the specified factory.- Parameters:
factory
- theModelFactory
modelName
- the model namereferenceModelName
- the reference model nameoptions
- 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 newIReferenceModel
using the specified factory.- Parameters:
factory
- theModelFactory
modelName
- the model nameoptions
- the creation options- Returns:
- the new
IReferenceModel
- Throws:
org.apache.tools.ant.BuildException
-
-