Package org.apache.tools.ant
Class BuildEvent
- java.lang.Object
- 
- java.util.EventObject
- 
- org.apache.tools.ant.BuildEvent
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class BuildEvent extends java.util.EventObjectClass 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.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description BuildEvent(Project project)Construct a BuildEvent for a project level event.BuildEvent(Target target)Construct a BuildEvent for a target level event.BuildEvent(Task task)Construct a BuildEvent for a task level event.
 - 
Method SummaryModifier and Type Method Description java.lang.ThrowablegetException()Returns the exception that was thrown, if any.java.lang.StringgetMessage()Returns the logging message.intgetPriority()Returns the priority of the logging message.ProjectgetProject()Returns the project that fired this event.TargetgetTarget()Returns the target that fired this event.TaskgetTask()Returns the task that fired this event.voidsetException(java.lang.Throwable exception)Sets the exception associated with this event.voidsetMessage(java.lang.String message, int priority)Sets the message and priority associated with this event.
 
- 
- 
- 
Constructor Detail- 
BuildEventpublic BuildEvent(Project project) Construct a BuildEvent for a project level event.- Parameters:
- project- the project that emitted the event. Should not be- null.
 
 - 
BuildEventpublic BuildEvent(Target target) Construct a BuildEvent for a target level event. The project associated with the event is derived from the given target.- Parameters:
- target- the target that emitted the event. Must not be- null.
 
 - 
BuildEventpublic 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.- Parameters:
- task- the task that emitted the event. Must not be- null.
 
 
- 
 - 
Method Detail- 
setMessagepublic void setMessage(java.lang.String message, int priority)Sets the message and priority associated with this event. This is used for "messageLogged" events.- Parameters:
- message- the message to be associated with this event. Should not be- null.
- priority- the priority to be associated with this event, as defined in the- Projectclass.
- See Also:
- BuildListener.messageLogged(BuildEvent)
 
 - 
setExceptionpublic void setException(java.lang.Throwable exception) Sets the exception associated with this event. This is used for "messageLogged", "taskFinished", "targetFinished", and "buildFinished" events.- Parameters:
- exception- The exception to be associated with this event. May be- null.
- See Also:
- BuildListener.messageLogged(BuildEvent),- BuildListener.taskFinished(BuildEvent),- BuildListener.targetFinished(BuildEvent),- BuildListener.buildFinished(BuildEvent)
 
 - 
getProjectpublic Project getProject() Returns the project that fired this event.- Returns:
- the project that fired this event
 
 - 
getTargetpublic Target getTarget() Returns the target that fired this event.- Returns:
- the project that fired this event, or nullif this event is a project level event.
 
 - 
getTaskpublic Task getTask() Returns the task that fired this event.- Returns:
- the task that fired this event, or nullif this event is a project or target level event.
 
 - 
getMessagepublic java.lang.String getMessage() Returns the logging message. This field will only be set for "messageLogged" events.- Returns:
- the message associated with this event, or nullif no message has been set.
- See Also:
- BuildListener.messageLogged(BuildEvent)
 
 - 
getPrioritypublic 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 theProjectclass.- Returns:
- the priority associated with this event.
- See Also:
- BuildListener.messageLogged(BuildEvent)
 
 - 
getExceptionpublic 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.- Returns:
- the exception associated with this exception, or
         nullif no exception has been set.
- See Also:
- BuildListener.messageLogged(BuildEvent),- BuildListener.taskFinished(BuildEvent),- BuildListener.targetFinished(BuildEvent),- BuildListener.buildFinished(BuildEvent)
 
 
- 
 
-