BuildEventpublic class BuildEvent extends EventObject Class representing an event occurring during a build. An
event is built by specifying either a project, a task or a target.
A project level event will only have a project reference;
a target level event will have project and target references;
a task level event will have project, target and task references. |
Fields Summary |
---|
private Project | projectProject which emitted the event. | private Target | targetTarget which emitted the event, if specified. | private Task | taskTask which emitted the event, if specified. | private String | messageMessage associated with the event. This is only used for
"messageLogged" events. | private int | priorityThe priority of the message, for "messageLogged" events. | private Throwable | exceptionThe exception associated with this event, if any.
This is only used for "messageLogged", "taskFinished", "targetFinished",
and "buildFinished" events. |
Constructors Summary |
---|
public BuildEvent(Project project)Construct a BuildEvent for a project level event.
super(project);
this.project = project;
this.target = null;
this.task = null;
| public BuildEvent(Target target)Construct a BuildEvent for a target level event.
The project associated with the event is derived
from the given target.
super(target);
this.project = target.getProject();
this.target = target;
this.task = null;
| public BuildEvent(Task task)Construct a BuildEvent for a task level event.
The project and target associated with the event
are derived from the given task.
super(task);
this.project = task.getProject();
this.target = task.getOwningTarget();
this.task = task;
|
Methods Summary |
---|
public java.lang.Throwable | getException()Returns the exception that was thrown, if any. This field will only
be set for "messageLogged", "taskFinished", "targetFinished", and "buildFinished"
events.
return exception;
| public java.lang.String | getMessage()Returns the logging message. This field will only be set
for "messageLogged" events.
return message;
| public int | getPriority()Returns the priority of the logging message. This field will only
be set for "messageLogged" events. The meaning of this priority
is as specified by the constants in the {@link Project Project} class.
return priority;
| public Project | getProject()Returns the project that fired this event.
return project;
| public Target | getTarget()Returns the target that fired this event.
return target;
| public Task | getTask()Returns the task that fired this event.
return task;
| public void | setException(java.lang.Throwable exception)Sets the exception associated with this event. This is used
for "messageLogged", "taskFinished", "targetFinished", and "buildFinished"
events.
this.exception = exception;
| public void | setMessage(java.lang.String message, int priority)Sets the message and priority associated with this event.
This is used for "messageLogged" events.
this.message = message;
this.priority = priority;
|
|