|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
Base class for all tasks. Use Project.createTask to create a new task instance rather than using this class directly for construction.
Project.createTask(java.lang.String)| Field Summary | |
protected java.lang.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 java.lang.String |
taskName
Name of this task to be used for logging purposes. |
protected java.lang.String |
taskType
Type of this task. |
protected RuntimeConfigurable |
wrapper
Wrapper for this object, used to configure it at runtime. |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
| Constructor Summary | |
Task()
Sole constructor. |
|
| Method Summary | |
void |
execute()
Called by the project to let the task do its work. |
java.lang.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. |
java.lang.String |
getTaskName()
Returns the name to use in logging messages. |
protected void |
handleErrorFlush(java.lang.String line)
Handles an error line by logging it with the INFO priority. |
protected void |
handleErrorOutput(java.lang.String line)
Handles an error line by logging it with the INFO priority. |
protected void |
handleFlush(java.lang.String line)
Handles a line of output by logging it with the INFO priority. |
protected void |
handleOutput(java.lang.String line)
Handles a line of 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(java.lang.String msg)
Logs a message with the default (INFO) priority. |
void |
log(java.lang.String msg,
int msgLevel)
Logs a mesage 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 |
setDescription(java.lang.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(java.lang.String name)
Sets the name to use in logging messages. |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Target target
protected java.lang.String description
protected Location location
protected java.lang.String taskName
protected java.lang.String taskType
protected RuntimeConfigurable wrapper
| Constructor Detail |
public Task()
| Method Detail |
public void setOwningTarget(Target target)
target - Target in whose scope this task belongs.
May be null, indicating a top-level task.public Target getOwningTarget()
null if
this task is a top-level task.public void setTaskName(java.lang.String name)
name - The name to use in logging messages.
Should not be null.public java.lang.String getTaskName()
public void setDescription(java.lang.String desc)
desc - Description of the current action.
May be null, indicating that no description is
available.public java.lang.String getDescription()
null if
no description is available.
public void init()
throws BuildException
BuildException - if someting goes wrong with the build
public void execute()
throws BuildException
BuildException - if something goes wrong with the buildpublic Location getLocation()
null. Location.UNKNOWN_LOCATION
is used for unknown locations.Location.UNKNOWN_LOCATIONpublic void setLocation(Location location)
location - The file/location where this task was defined.
Should not be null - use
Location.UNKNOWN_LOCATION if the location isn't known.Location.UNKNOWN_LOCATIONpublic RuntimeConfigurable getRuntimeConfigurableWrapper()
public void setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)
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.
public void maybeConfigure()
throws BuildException
BuildException - if the task cannot be configured.protected void handleOutput(java.lang.String line)
line - The line of output to log. Should not be null.protected void handleFlush(java.lang.String line)
line - The line of output to log. Should not be null.protected void handleErrorOutput(java.lang.String line)
line - The error line to log. Should not be null.protected void handleErrorFlush(java.lang.String line)
line - The error line to log. Should not be null.public void log(java.lang.String msg)
log in class ProjectComponentmsg - The message to be logged. Should not be null.
public void log(java.lang.String msg,
int msgLevel)
log in class ProjectComponentmsg - The message to be logged. Should not be null.msgLevel - The message priority at which this message is to
be logged.public final void perform()
protected final boolean isInvalid()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||