org.apache.tools.ant
Class ProjectComponent
java.lang.Object
org.apache.tools.ant.ProjectComponent
- Cloneable
public abstract class ProjectComponent
extends java.lang.Object
implements Cloneable
Base class for components of a project, including tasks and data types.
Provides common facilities.
Object | clone()
|
String | getDescription() - Returns the description of the current action.
|
Location | getLocation() - Returns the file/location where this task was defined.
|
Project | getProject() - Returns the project to which this component belongs.
|
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 | setDescription(String desc) - Sets a description of the current action.
|
void | setLocation(Location location) - Sets the file/location where this task was defined.
|
void | setProject(Project project) - Sets the project object of this component.
|
description
protected String description
since 1.6.x.
You should not be accessing this variable directly.
Description of this component, if any.
location
protected Location location
since 1.6.x.
You should not be accessing this variable directly.
Please use the getLocation()
method.
Location within the build file of this task definition.
project
protected Project project
since 1.6.x.
You should not be directly accessing this variable directly.
You should access project object via the getProject()
or setProject() accessor/mutators.
Project object of this component.
ProjectComponent
public ProjectComponent()
Sole constructor.
clone
public Object clone()
throws CloneNotSupportedException
- a shallow copy of this projectcomponent.
getDescription
public String getDescription()
Returns the description of the current action.
- the description of the current action, or
null
if
no description is available.
getLocation
public Location getLocation()
Returns the file/location where this task was defined.
- the file/location where this task was defined.
Should not return
null
. Location.UNKNOWN_LOCATION
is used for unknown locations.
getProject
public Project getProject()
Returns the project to which this component belongs.
- the components's project.
log
public void log(String msg)
Logs a message with the default (INFO) priority.
msg
- The message to be logged. Should not be null
.
log
public void log(String msg,
int msgLevel)
Logs a message with the given priority.
msg
- The message to be logged. Should not be null
.msgLevel
- the message priority at which this message is
to be logged.
setDescription
public void setDescription(String desc)
Sets a description of the current action. This may be used for logging
purposes.
desc
- Description of the current action.
May be null
, indicating that no description is
available.
setLocation
public void setLocation(Location location)
Sets the file/location where this task was defined.
location
- The file/location where this task was defined.
Should not be null
--use
Location.UNKNOWN_LOCATION if the location isn't known.
setProject
public void setProject(Project project)
Sets the project object of this component. This method is used by
Project when a component is added to it so that the component has
access to the functions of the project. It should not be used
for any other purpose.
project
- Project in whose scope this component belongs.
Must not be null
.