# parser/DataTypeHandler.php

Configures a Project (complete with Targets and Tasks) based on a XML build file.

<

p> Design/ZE2 migration note: If PHP would support nested classes. All the phing/parser/*Filter classes would be nested within this class

Access
  public
Author
  Andreas Aderhold
Copyright
  © 2001,2002 THYRELL. All rights reserved
Package
  phing.parser
Version
  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

## \DataTypeHandler
jump to top

Package: phing\parser

Configures a Project (complete with Targets and Tasks) based on a XML build file.

<

p> Design/ZE2 migration note: If PHP would support nested classes. All the phing/parser/*Filter classes would be nested within this class

Parent(s)
  \AbstractHandler
Access
  public
Author
  Andreas Aderhold
Copyright
  © 2001,2002 THYRELL. All rights reserved
Version
  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

### Properties

`$element= ''`
Details

Type

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

`$target= ''`
Details

Type

`$wrapper= ''`
Details

Type

### Methods

`__construct( \AbstractSAXParser $parser, \AbstractHandler $parentHandler, \ProjectConfigurator $configurator, \Target $target = null ) : void`

Constructs a new DataTypeHandler and sets up everything.

The constructor must be called by all derived classes.

Parameters

Name | Type | Description
--- | --- | ---
$parser | \AbstractSAXParser | The XML parser (default: ExpatParser)
$parentHandler | \AbstractHandler | The parent handler that invoked this handler.
$configurator | \ProjectConfigurator | The ProjectConfigurator object
$target | \Target | The target object this datatype is contained in (null for top-level datatypes).

`characters( string $data ) : void`

Handles character data.

Parameters

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

Details

Access
  public

`endElement( string $name ) : void`

Overrides endElement for data types. Tells the type handler that processing the element had been finished so handlers know they can perform actions that need to be based on the data contained within the element.

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 $propType, array $attrs ) : void`

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

<

p> This includes:

- creation of the datatype object
- calling the setters for attributes
- adding the type to the target object if any
- adding a reference to the task (if id attribute is given)

Parameters

Name | Type | Description
--- | --- | ---
$propType | string | the tag that comes in
$attrs | array | attributes the tag carries

Throws

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

Details

Access
  public

`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

Details

Access
  public

Documentation was generated by DocBlox 0.15.1.