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.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.
See Also:
Serialized Form
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors 
    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 Summary

    Modifier and Type Method Description
    java.lang.Throwable getException()
    Returns the exception that was thrown, if any.
    java.lang.String getMessage()
    Returns the logging message.
    int getPriority()
    Returns the priority of the logging message.
    Project getProject()
    Returns the project that fired this event.
    Target getTarget()
    Returns the target that fired this event.
    Task getTask()
    Returns the task that fired this event.
    void setException​(java.lang.Throwable exception)
    Sets the exception associated with this event.
    void setMessage​(java.lang.String message, int priority)
    Sets the message and priority associated with this event.

    Methods inherited from class java.util.EventObject

    getSource, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BuildEvent

      public BuildEvent​(Project project)
      Construct a BuildEvent for a project level event.
      Parameters:
      project - the project that emitted the event. Should not be null.
    • BuildEvent

      public 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.
    • BuildEvent

      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.
      Parameters:
      task - the task that emitted the event. Must not be null.
  • Method Details