# parser/TargetHandler.php

The target handler class.

This class handles the occurance of a tag and it's possible nested tags (datatypes and tasks).

Author
  Andreas Aderhold
Copyright
  2001,2002 THYRELL. All rights reserved
Package
  phing.parser
Version
  $Revision: 914 $

## \TargetHandler
jump to top

Package: phing\parser

The target handler class.

This class handles the occurance of a tag and it's possible nested tags (datatypes and tasks).

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

### Properties

`\ProjectConfigurator $configurator= ''`

The phing project configurator object

Details

Type
  \ProjectConfigurator

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

Type
Inherited_from
  \AbstractHandler::$parentHandler

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

Type
Inherited_from
  \AbstractHandler::$parser

`object $target= ''`

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

the target instance
Details

Type
  object

### Methods

`__construct( object $parser, object $parentHandler, object $configurator ) : void`

Constructs a new TargetHandler

The constructor must be called by all derived classes.

Parameters

Name | Type | Description
--- | --- | ---
$parser | object | the ExpatParser object
$parentHandler | object | the parent handler that invoked this handler
$configurator | object | the ProjectConfigurator object

`characters( string $data ) : void`
inherited

Invoked by occurance of #PCDATA.

Inherited from: \AbstractHandler::characters()
Parameters

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

Details

Access
  public
Exception
  ExpatParserException if there is no CDATA but method was called

`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`
inherited

Gets invoked when element closes method.

Inherited from: \AbstractHandler::finished()
`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 target object
- calling the setters for attributes
- adding the target to the project
- adding a reference to the target (if id attribute is given)

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.15.1.