# parser/RootHandler.php

## \RootHandler
jump to top

Package: phing\parser

Root filter class for a phing buildfile.

The root filter is called by the parser first. This is where the phing specific parsing starts. RootHandler decides what to do next.

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

### Properties

`$configurator= ''`

The phing project configurator object

Details

Type
  n/a

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

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

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

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

### Methods

`__construct( \AbstractSAXParser $parser, \ProjectConfigurator $configurator ) : void`

Constructs a new RootHandler

The root filter is required so the parser knows what to do. It's called by the ExpatParser that is instatiated in ProjectConfigurator.

It recieves the expat parse object ref and a reference to the configurator

Parameters

Name | Type | Description
--- | --- | ---
$parser | \AbstractSAXParser | The ExpatParser object.
$configurator | \ProjectConfigurator | 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()
`startElement( string $tag, array $attrs ) : void`

Kick off a custom action for a start element tag.

The root element of our buildfile is the <project> element. The root filter handles this element if it occurs, creates ProjectHandler to handle any nested tags & attributes of the <project> tag, and calls init.

Parameters

Name | Type | Description
--- | --- | ---
$tag | string | The xml tagname
$attrs | array | The attributes of the tag

Throws

Exception | Description
--- | ---
\ExpatParseException | if the first element within our build file is not the >project< element

Documentation was generated by DocBlox 0.17.1.