The task handler class.

This class handles the occurance of a tag and it's possible nested tags (datatypes and tasks) that may be unknown off bat and are initialized on the fly.

author | Andreas Aderhold
copyright | 2001,2002 THYRELL. All rights reserved
version | $Id: 3b31bb3e2c1ae122411833c67617e7cebf6967b8 $
package | phing.parser

### Methods

## Constructs a new TaskHandler and sets up everything.

    __construct(\AbstractSAXParser $parser, object $parentHandler, \ProjectConfigurator $configurator, \TaskContainer $container, \RuntimeConfigurable $parentWrapper, \Target $target)

The constructor must be called by all derived classes.

### Parameters

#### $parser

`\AbstractSAXParser`

The ExpatParser object

#### $parentHandler

`object`

The parent handler that invoked this handler

#### $configurator

`\ProjectConfigurator`

#### $container

`\TaskContainer`

The container object this task is contained in (null for top-level tasks).

#### $parentWrapper

`\RuntimeConfigurable`

Wrapper for the parent element, if any.

#### $target

`\Target`

The target object this task is contained in (null for top-level tasks).

## Handles character data.

    characters(string $data)

### Parameters

#### $data

`string`

The CDATA that comes in

## Gets invoked when a XML element ends.

    endElement(string $name)

Inherited

Can be overloaded by the child class. But should not. It hands over control to the parentHandler of this.

inherited_from | \AbstractHandler::endElement()

### Parameters

#### $name

`string`

the name of the XML element

## Executes initialization actions required to setup the data structures related to the tag.

    init(string $tag, array $attrs)

<

p> This includes:

- creation of the task object
- calling the setters for attributes
- adding the task to the container object
- adding a reference to the task (if id attribute is given)
- executing the task if the container is the <project> element

### Parameters

#### $tag

`string`

The tag that comes in

#### $attrs

`array`

Attributes the tag carries

### Exceptions

`\ExpatParseException` | if attributes are incomplete or invalid

## Checks for nested tags within the current one.

    startElement(string $name, array $attrs)

Creates and calls handlers respectively.

### Parameters

#### $name

`string`

The tag that comes in

#### $attrs

`array`

Attributes the tag carries

## Executes the task at once if it's directly beneath the <project> tag.

    finished()

### Properties

##

    $parentHandler

Inherited

inherited_from | \AbstractHandler::$$parentHandler

##

    $parser

Inherited

inherited_from | \AbstractHandler::$$parser

##

    $configurator : \ProjectConfigurator

##

    $container : object

This must not necessarily be a target, hence extra variable.

##

    $parentWrapper : \RuntimeConfigurable

The wrapper for this element will be added to this wrapper as a child.

##

    $target : object

##

    $task : \Task

##

    $wrapper

Otherwise the configuration is performed with the configure method.

see | \global\ProjectHelper::configure(Object,AttributeList,Project)