org.apache.tools.ant
public abstract class Task extends ProjectComponent
See Also: Project
Field Summary | |
---|---|
protected String | description
Description of this task, if any. |
protected Location | location
Location within the build file of this task definition. |
protected Target | target
Target this task belongs to, if any. |
protected String | taskName
Name of this task to be used for logging purposes.
|
protected String | taskType
Type of this task.
|
protected RuntimeConfigurable | wrapper
Wrapper for this object, used to configure it at runtime.
|
Constructor Summary | |
---|---|
Task() Sole constructor. |
Method Summary | |
---|---|
void | execute()
Called by the project to let the task do its work. |
String | getDescription()
Returns the description of the current action.
|
Location | getLocation()
Returns the file/location where this task was defined.
|
Target | getOwningTarget()
Returns the container target of this task.
|
RuntimeConfigurable | getRuntimeConfigurableWrapper()
Returns the wrapper used for runtime configuration.
|
String | getTaskName()
Returns the name to use in logging messages.
|
String | getTaskType()
Return the type of task
|
protected RuntimeConfigurable | getWrapper()
Return the runtime configurable structure for this task
|
protected void | handleErrorFlush(String output)
Handles an error line by logging it with the WARN priority.
|
protected void | handleErrorOutput(String output)
Handles an error output by logging it with the WARN priority.
|
protected void | handleFlush(String output)
Handles output by logging it with the INFO priority.
|
protected int | handleInput(byte[] buffer, int offset, int length)
Handle an input request by this task
|
protected void | handleOutput(String output)
Handles output by logging it with the INFO priority.
|
void | init()
Called by the project to let the task initialize properly.
|
protected boolean | isInvalid()
Has this task been marked invalid?
|
void | log(String msg)
Logs a message with the default (INFO) priority.
|
void | log(String msg, int msgLevel)
Logs a message with the given priority. |
void | maybeConfigure()
Configures this task - if it hasn't been done already.
|
void | perform()
Performs this task if it's still valid, or gets a replacement
version and performs that otherwise.
|
void | reconfigure()
Force the task to be reconfigured from it's RuntimeConfigurable
|
void | setDescription(String desc)
Sets a description of the current action. |
void | setLocation(Location location)
Sets the file/location where this task was defined.
|
void | setOwningTarget(Target target)
Sets the target container of this task.
|
void | setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)
Sets the wrapper to be used for runtime configuration.
|
void | setTaskName(String name)
Sets the name to use in logging messages.
|
void | setTaskType(String type)
Sets the name with which the task has been invoked.
|
Deprecated: You should not be accessing this variable directly.
Description of this task, if any.Deprecated: You should not be accessing this variable directly. Please use the {@link #getLocation()} method.
Location within the build file of this task definition.Deprecated: You should not be accessing this variable directly. Please use the {@link #getOwningTarget()} method.
Target this task belongs to, if any.Deprecated: You should not be accessing this variable directly. Please use the {@link #getTaskName()} method.
Name of this task to be used for logging purposes. This defaults to the same as the type, but may be overridden by the user. For instance, the name "java" isn't terribly descriptive for a task used within another task - the outer task code can probably provide a better one.Deprecated: You should not be accessing this variable directly. Please use the {@link #getTaskType()} method.
Type of this task.Deprecated: You should not be accessing this variable directly. Please use the {@link #getWrapper()} method.
Wrapper for this object, used to configure it at runtime.Throws: BuildException if something goes wrong with the build
Returns: the description of the current action, or null
if
no description is available.
Returns: the file/location where this task was defined.
Should not return null
. Location.UNKNOWN_LOCATION
is used for unknown locations.
See Also: UNKNOWN_LOCATION
Returns: The target containing this task, or null
if
this task is a top-level task.
Returns: the wrapper used for runtime configuration. This method will generate a new wrapper (and cache it) if one isn't set already.
Returns: the name to use in logging messages.
Returns: the type of task
Returns: the runtime structure for this task
Parameters: output The error output to log. Should not be null
.
Since: Ant 1.5.2
Parameters: output The error output to log. Should not be null
.
Parameters: output The output to log. Should not be null
.
Since: Ant 1.5.2
Parameters: buffer the buffer into which data is to be read. offset the offset into the buffer at which data is stored. length the amount of data to read
Returns: the number of bytes read
Throws: IOException if the data cannot be read
Since: Ant 1.6
Parameters: output The output to log. Should not be null
.
Throws: BuildException if something goes wrong with the build
Returns: true if this task is no longer valid. A new task should be configured in this case.
Since: Ant 1.5
Parameters: msg The message to be logged. Should not be null
.
Parameters: msg The message to be logged. Should not be null
. msgLevel The message priority at which this message is to
be logged.
Throws: BuildException if the task cannot be configured.
Parameters: desc Description of the current action.
May be null
, indicating that no description is
available.
Parameters: location The file/location where this task was defined.
Should not be null
- use
Location.UNKNOWN_LOCATION if the location isn't known.
See Also: UNKNOWN_LOCATION
Parameters: target Target in whose scope this task belongs.
May be null
, indicating a top-level task.
Parameters: wrapper The wrapper to be used for runtime configuration.
May be null
, in which case the next call
to getRuntimeConfigurableWrapper will generate a new
wrapper.
Parameters: name The name to use in logging messages.
Should not be null
.
Parameters: type The name the task has been invoked as.
Should not be null
.