# parser/TaskHandler.php

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
Package
  phing.parser
Version
  $Revision: 912 $

## \TaskHandler
jump to top

Package: phing\parser

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.

Parent(s)
  \AbstractHandler
Author
  Andreas Aderhold
Copyright
  2001,2002 THYRELL. All rights reserved
Version
  $Revision: 912 $

### Properties

`\ProjectConfigurator $configurator= ''`

The phing project configurator object

Details

Type
  \ProjectConfigurator

`object $container= ''`

Reference to the target object that represents the currently parsed target. This must not necessarily be a target, hence extra variable.

the target instance
Details

Type
  object

`$parentHandler= 'null'`
inherited Inherited from: \AbstractHandler::$$parentHandler
Default value `null` Details

Type
  n/a
Inherited_from
  \AbstractHandler::$$parentHandler

`\RuntimeConfigurable $parentWrapper= ''`

Wrapper for the parent element, if any. The wrapper for this element will be added to this wrapper as a child.

Details

Type
  \RuntimeConfigurable

`$parser= 'null'`
inherited Inherited from: \AbstractHandler::$$parser
Default value `null` Details

Type
  n/a
Inherited_from
  \AbstractHandler::$$parser

`object $target= ''`

Reference to the target object that contains the currently parsed task

the target instance
Details

Type
  object

`\Task $task= ''`

Reference to the task object that represents the currently parsed target.

Details

Type
  \Task

`$wrapper= ''`

Wrapper for this element which takes care of actually configuring the element, if this element is contained within a target.

Otherwise the configuration is performed with the configure method.

Details

Type
  n/a
See
  \ProjectHelper::configure(Object,AttributeList,Project)

### Methods

`__construct( \AbstractSAXParser $parser, object $parentHandler, \ProjectConfigurator $configurator, \TaskContainer $container = null, \RuntimeConfigurable $parentWrapper = null, \Target $target = null ) : void`

Constructs a new TaskHandler and sets up everything.

The constructor must be called by all derived classes.

Parameters

Name | Type | Description
--- | --- | ---
$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).

`characters( string $data ) : void`

Handles character data.

Parameters

Name | Type | Description
--- | --- | ---
$data | string | The CDATA that comes in

`endElement( string $name ) : void`
inherited

Gets invoked when a XML element ends.

Inherited from: \AbstractHandler::endElement()

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

Parameters

Name | Type | Description
--- | --- | ---
$name | string | the name of the XML element

`finished( ) : void`

Executes the task at once if it's directly beneath the tag.

`init( string $tag, array $attrs ) : void`

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

<

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

Name | Type | Description
--- | --- | ---
$tag | string | The tag that comes in
$attrs | array | Attributes the tag carries

Throws

Exception | Description
--- | ---
\ExpatParseException | if attributes are incomplete or invalid

`startElement( string $name, array $attrs ) : void`

Checks for nested tags within the current one. Creates and calls handlers respectively.

Must be overloaded by the child class. Throws an ExpatParseException if there is no handler registered for an element.

Parameters

Name | Type | Description
--- | --- | ---
$name | string | The tag that comes in
$attrs | array | Attributes the tag carries

Documentation was generated by DocBlox 0.17.1.