Project#createTask
| Modifier and Type | Field and Description |
|---|---|
| private boolean | invalid
Whether or not this task is invalid. |
| private UnknownElement | replacement
Replacement element used if this task is invalidated. |
| 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. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | bindToOwner(Task
owning target owner)Bind a task to another; use this when configuring a newly created task to do work on behalf of another. |
| public void | |
| public Target | Returns: The target containing this task, ornull if
this task is a top-level task.Returns the container target of this task. |
| private UnknownElement | Returns: the UnknownElement instance for the new definition of this task.Creates an UnknownElement that can be used to replace this task. |
| public RuntimeConfigurable | 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 wrapper used for runtime configuration. |
| public String | Returns: the name to use in logging messages.Returns the name to use in logging messages. |
| public String | |
| protected RuntimeConfigurable | Returns: the runtime structure for this task.Return the runtime configurable structure for this task. |
| protected void | handleErrorFlush(String
The error output to log. Should not be output)null.Handles an error line by logging it with the WARN priority. |
| protected void | handleErrorOutput(String
The error output to log. Should not be output)null.Handles an error output by logging it with the WARN priority. |
| protected void | handleFlush(String
The output to log. Should not be output)null.Handles output by logging it with the INFO priority. |
| protected int | Returns: the number of bytes read.the buffer into which data is to be read. buffer, int the offset into the buffer at which data is stored. offset, int the amount of data to read. length)Handle an input request by this task. |
| protected void | handleOutput(String
The output to log. Should not be output)null.Handles output by logging it with the INFO priority. |
| public void | |
| protected final boolean | Returns: true if this task is no longer valid. A new task should be configured in this case.Has this task been marked invalid? |
| public void | log(String
The message to be logged. Should not be msg)null.Overrides org. |
| public void | log(String
The message to be logged. Should not be msg, int null.The message priority at which this message is to
be logged. msgLevel)Overrides org. |
| public void | |
| public void | |
| pack-priv final void | |
| public void | |
| public final void | perform()
Performs this task if it's still valid, or gets a replacement version and performs that otherwise. |
| public void | |
| private void | replaceChildren(RuntimeConfigurable wrapper, UnknownElement parentElement)
Recursively adds an UnknownElement instance for each child element of replacement. |
| public void | setOwningTarget(Target
Target in whose scope this task belongs.
May be target)null, indicating a top-level task.Sets the target container of this task. |
| public void | setRuntimeConfigurableWrapper(RuntimeConfigurable
The wrapper to be used for runtime configuration.
May be wrapper)null, in which case the next call
to getRuntimeConfigurableWrapper will generate a new
wrapper.Sets the wrapper to be used for runtime configuration. |
| public void | setTaskName(String
The name to use in logging messages.
Should not be name)null.Sets the name to use in logging messages. |
| public void | setTaskType(String
The name the task has been invoked as.
Should not be type)null.Sets the name with which the task has been invoked. |
| invalid | back to summary |
|---|---|
| private boolean invalid Whether or not this task is invalid. A task becomes invalid if a conflicting class is specified as the implementation for its type. | |
| replacement | back to summary |
|---|---|
| private UnknownElement replacement Replacement element used if this task is invalidated. | |
| target | back to summary |
|---|---|
| protected Target target
Deprecated since 1.6.x.
You should not be accessing this variable directly.
Please use the Target this task belongs to, if any. | |
| taskName | back to summary |
|---|---|
| protected String taskName
Deprecated since 1.6.x.
You should not be accessing this variable directly.
Please use the 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. | |
| taskType | back to summary |
|---|---|
| protected String taskType
Deprecated since 1.6.x.
You should not be accessing this variable directly.
Please use the Type of this task. | |
| wrapper | back to summary |
|---|---|
| protected RuntimeConfigurable wrapper
Deprecated since 1.6.x.
You should not be accessing this variable directly.
Please use the Wrapper for this object, used to configure it at runtime. | |
| Task | back to summary |
|---|---|
| public Task() | |
| bindToOwner | back to summary |
|---|---|
| public final void bindToOwner(Task owner) Bind a task to another; use this when configuring a newly created task to do work on behalf of another. Project, OwningTarget, TaskName, Location and Description are all copied Important Note this method does not call
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
| |
| getOwningTarget | back to summary |
|---|---|
| public Target getOwningTarget() Returns the container target of this task.
| |
| getReplacement | back to summary |
|---|---|
| private UnknownElement getReplacement() Creates an UnknownElement that can be used to replace this task. Once this has been created once, it is cached and returned by future calls.
| |
| getRuntimeConfigurableWrapper | back to summary |
|---|---|
| public RuntimeConfigurable getRuntimeConfigurableWrapper() Returns the wrapper used for runtime configuration.
| |
| getTaskName | back to summary |
|---|---|
| public String getTaskName() Returns the name to use in logging messages.
| |
| getTaskType | back to summary |
|---|---|
| public String getTaskType() Return the type of task.
| |
| getWrapper | back to summary |
|---|---|
| protected RuntimeConfigurable getWrapper() Return the runtime configurable structure for this task.
| |
| handleErrorFlush | back to summary |
|---|---|
| protected void handleErrorFlush(String output) Handles an error line by logging it with the WARN priority.
| |
| handleErrorOutput | back to summary |
|---|---|
| protected void handleErrorOutput(String output) Handles an error output by logging it with the WARN priority.
| |
| handleFlush | back to summary |
|---|---|
| protected void handleFlush(String output) Handles output by logging it with the INFO priority.
| |
| handleInput | back to summary |
|---|---|
| protected int handleInput(byte[] buffer, int offset, int length) throws IOException Handle an input request by this task.
| |
| handleOutput | back to summary |
|---|---|
| protected void handleOutput(String output) Handles output by logging it with the INFO priority.
| |
| init | back to summary |
|---|---|
| public void init() throws BuildException Called by the project to let the task initialize properly. The default implementation is a no-op.
| |
| isInvalid | back to summary |
|---|---|
| protected final boolean isInvalid() Has this task been marked invalid?
| |
| log | back to summary |
|---|---|
| public void log(String msg) Overrides org. Logs a message with the default (INFO) priority.
| |
| log | back to summary |
|---|---|
| public void log(String msg, int msgLevel) Overrides org. Logs a message with the given priority. This delegates the actual logging to the project.
| |
| log | back to summary |
|---|---|
| public void log(Throwable t, int msgLevel) Logs a message with the given priority. This delegates the actual logging to the project.
| |
| log | back to summary |
|---|---|
| public void log(String msg, Throwable t, int msgLevel) Logs a message with the given priority. This delegates the actual logging to the project. | |
| markInvalid | back to summary |
|---|---|
| pack-priv final void markInvalid() Marks this task as invalid. Any further use of this task will go through a replacement with the updated definition. | |
| maybeConfigure | back to summary |
|---|---|
| public void maybeConfigure() throws BuildException Configures this task - if it hasn't been done already. If the task has been invalidated, it is replaced with an UnknownElement task which uses the new definition in the project.
| |
| perform | back to summary |
|---|---|
| public final void perform() Performs this task if it's still valid, or gets a replacement version and performs that otherwise. Performing a task consists of firing a task started event, configuring the task, executing it, and then firing task finished event. If a runtime exception is thrown, the task finished event is still fired, but with the exception as the cause. | |
| reconfigure | back to summary |
|---|---|
| public void reconfigure() Force the task to be reconfigured from its RuntimeConfigurable. | |
| replaceChildren | back to summary |
|---|---|
| private void replaceChildren(RuntimeConfigurable wrapper, UnknownElement parentElement) Recursively adds an UnknownElement instance for each child element of replacement.
| |
| setOwningTarget | back to summary |
|---|---|
| public void setOwningTarget(Target target) Sets the target container of this task.
| |
| setRuntimeConfigurableWrapper | back to summary |
|---|---|
| public void setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper) Sets the wrapper to be used for runtime configuration. This method should be used only by the ProjectHelper and Ant internals. It is public to allow helper plugins to operate on tasks, normal tasks should never use it.
| |
| setTaskName | back to summary |
|---|---|
| public void setTaskName(String name) Sets the name to use in logging messages.
| |
| setTaskType | back to summary |
|---|---|
| public void setTaskType(String type) Sets the name with which the task has been invoked.
| |