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.TaskCommon ATL task:- handle atl log.
- provide utility methods.
- handle finalization (dispose of models).
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_LAUNCHERDefault launcher name.static java.lang.StringDEFAULT_MODEL_HANDLERDefault model handler name.static java.lang.StringLAUNCHER_PROPERTYThe launcher property name.static java.lang.StringOPTION_MODEL_HANDLERThe model handler name.static java.lang.StringOPTION_MODEL_NAMEThe model name.static java.lang.StringOPTION_MODEL_PATHThe model path.static java.lang.StringOPTION_NEW_MODELThe newModel boolean.static java.lang.StringRESULT_REFERENCEThe result reference name.
-
Constructor Summary
Constructors Constructor Description AbstractAtlTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiderror(java.lang.String msg)Stops the build, deletes log.protected voiderror(java.lang.String msg, java.lang.Throwable e)Stops the build, deletes log.voidexecute()protected ModelFactorygetDefaultModelFactory()Returns the default modelFactory for this launcher.protected ILaunchergetLauncher()Returns the launcher.protected java.lang.StringgetLauncherName()Returns the launcher name.voidinit()protected IModelnewModel(java.lang.String factoryName, java.lang.String modelName, java.lang.String referenceModelName, java.util.Map<java.lang.String,java.lang.Object> options)Creates a newIModelusing the specified factory.protected IModelnewModel(ModelFactory factory, java.lang.String modelName, java.lang.String referenceModelName, java.util.Map<java.lang.String,java.lang.Object> options)Creates a newIModelusing the specified factory.protected IReferenceModelnewReferenceModel(ModelFactory factory, java.lang.String modelName, java.util.Map<java.lang.String,java.lang.Object> options)Creates a newIReferenceModelusing 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:
initin 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:
executein 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 newIModelusing the specified factory.- Parameters:
factoryName- theModelFactorynamemodelName- 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 newIModelusing the specified factory.- Parameters:
factory- theModelFactorymodelName- 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 newIReferenceModelusing the specified factory.- Parameters:
factory- theModelFactorymodelName- the model nameoptions- the creation options- Returns:
- the new
IReferenceModel - Throws:
org.apache.tools.ant.BuildException
-
-