Encapsulates a build specific event.

<

p>We have three sources of events all handled by this class:

- Project level events
- Target level events
- Task level events

<

p> Events are all fired from the project class by creating an event object using this class and passing it to the listeners.

author | Andreas Aderhold
author | Hans Lellelid
version | $Id$
package | phing

### Methods

## Construct a BuildEvent for a project, task or target source event

    __construct(object $source)

### Parameters

#### $source

`object`

project the project that emitted the event.

## Returns the exception that was thrown, if any.

    getException() : \Exception

This field will only be set for "taskFinished", "targetFinished", and "buildFinished" events.

see | \global\BuildListener::taskFinished()
see | \global\BuildListener::targetFinished()
see | \global\BuildListener::buildFinished()

### Returns

`\Exception`

## Returns the logging message.

    getMessage() : string

This field will only be set for "messageLogged" events.

### Returns

`string`The log message

## Returns the priority of the logging message.

    getPriority() : integer

This field will only be set for "messageLogged" events.

### Returns

`integer`The message priority

## Returns the project instance that fired this event.

    getProject() : \Project

The reference to the project instance is set by the constructor if this event was fired from the project class.

### Returns

`\Project`The project instance that fired this event

## The object on which the Event initially occurred.

    getSource()

Inherited

inherited_from | \EventObject::getSource()

## Returns the target instance that fired this event.

    getTarget() : \Target

The reference to the target instance is set by the constructor if this event was fired from the target class.

### Returns

`\Target`The target that fired this event

## Returns the target instance that fired this event.

    getTask() : \Task

The reference to the task instance is set by the constructor if this event was fired within a task.

### Returns

`\Task`The task that fired this event

## Set the exception that was the cause of this event.

    setException(\Exception $exception)

### Parameters

#### $exception

`\Exception`

The exception that caused the event

## Sets the message with details and the message priority for this event.

    setMessage(string $message, integer $priority)

### Parameters

#### $message

`string`

The string message of the event

#### $priority

`integer`

The priority this message should have

## Returns a String representation of this EventObject.

    toString()

Inherited

inherited_from | \EventObject::toString()

### Properties

##

    $exception : object

##

    $message : string

##

    $priority : string

see | \global\$message

##

    $project : \Project

##

    $source

Inherited

inherited_from | \EventObject::$$source

##

    $target : \Target

##

    $task : \Task