org.schmant.task
Interface TaskSpecification<T extends TaskSpecification<T>>

All Superinterfaces:
LoggingConfigurable<T>
All Known Subinterfaces:
ActionTaskSpec<T>, GeneratorTaskSpec<T>, ProcessTaskSpec<T>, RecursiveActionTaskSpec<T>, RecursiveProcessTaskSpec<T>
All Known Implementing Classes:
AbstractActionTask, AbstractAddTextTask, AbstractCallbackRecursiveActionTask, AbstractCallbackRecursiveProcessTask, AbstractExtJavaTask, AbstractExtJvmTask, AbstractExtProcessTask, AbstractGeneratorTask, AbstractJarTask, AbstractJavacTask, AbstractJavadocTask, AbstractJavaZipTask, AbstractLinkInsertionTask, AbstractParseXmlTask, AbstractProcessOneFileTask, AbstractProcessTask, AbstractProxyTask, AbstractSvnCommitTask, AbstractSvnTask, AbstractTask, AbstractTextInsertionTask, AbstractXmlCatalogActionTask, AbstractZipTask, AddSystemIdToCatalogTask, AddUriToCatalogTask, AntTask, ApiLinksTask, ArgumentInterpreterLinksTask, At4JZipTask, BZip2Task, ChmodTask, ClosureTask, CompoundTask, CopyTask, DeleteTask, DomParseXmlTask, EarTask, ErrorIgnoringTask, ExtFindbugsTask, ExtJarSignerTask, ExtJavacTask, ExtJavadocTask, ExtJavaTask, ExtJUnit4Task, ExtProcessTask, ForEachSourceTask, FormatCharacterFileTask, GZipTask, HtmlLinkValidationTask, IncludeFilesTask, JarTask, Jdk6JavacTask, LzmaTask, MoveTask, RecursiveActionTask, RecursiveProcessTask, RedirectReportTask, ReplaceSourceFileTask, SchemaFactoryTask, SchmantTaskrefTask, SvnExportTask, SvnUrlToUrlCopyTask, TarTask, TaskFactoryLinksTask, TemplateCompilerTask, TextAppendTask, TextPrependTask, TextReplaceTask, TimedExecutionTask, TreeCopyTask, TreeDeleteTask, WarTask, XsltTask, ZipTask

public interface TaskSpecification<T extends TaskSpecification<T>>
extends LoggingConfigurable<T>

A task specification is an object used by a TaskFactory to configure and create a Task. Unlike the task factory, the task specification is never reused to create several tasks. After creating a task, the next time a task factory setter method is called, the task factory copies its previous task specification (using copyProperties(TaskSpecification)) and starts to configure the new specification object.

In practice, Task:s are their own task specification objects.

Since:
0.9
Author:
Karl Gustafsson

Method Summary
 void copyProperties(T spec)
          Copy this specification's properties to the supplied specification object.
 Task createTask()
          Create a task from this specification object.
 
Methods inherited from interface org.schmant.task.confable.LoggingConfigurable
setLogFooter, setLogHeader, setReportLevel, setTraceLogging
 

Method Detail

createTask

Task createTask()
Create a task from this specification object.

This method is called by the task factory. After calling this method, the task factory does not modify the specification any more.

Returns:
A new task.

copyProperties

void copyProperties(T spec)
                    throws UnsupportedOperationException
Copy this specification's properties to the supplied specification object. This is used by the task factory to create a new specification object after it has created a task.

If a property is immutable, it can be reused in the target specification. If it is not immutable, such as for instance a collection or a map, a copied should be assigned to the target object.

Note: Implementations must call super.copyProperties(spec).

If the task and the task specification is the same object (which they always are), properties pertaining to the state of the task should not be copied to the new specification.

Throws:
UnsupportedOperationException