ElementHandler

Extends \AbstractHandler

The generic element handler class.

This class handles the occurrence of runtime registered tags like datatypes (fileset, patternset, etc) and it's possible nested tags. It introspects the implementation of the class and sets up the data structures.

author

Michiel Rook [email protected]

copyright

2001,2002 THYRELL. All rights reserved

version

$Id: f565e4518b5619f9c1c906ce06cf26eeda2d1cf6 $

package

phing.parser

Methods

Constructs a SAX handler parser.

__construct(\ExpatParser $parser, \AbstractHandler $parentHandler) 
inherited

The constructor must be called by all derived classes.

Arguments

$parser

\ExpatParser

the parser object

$parentHandler

\AbstractHandler

the parent handler of this handler

Invoked by occurrence of #PCDATA.

characters(string $data) 
inherited
exception

ExpatParseException if there is no CDATA but method was called

Throws
\ExpatParseException

Arguments

$data

string

contents

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.

Arguments

$name

string

the name of the XML element

Gets invoked when element closes method.

finished() 
inherited

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

init(string $tag, array $attrs) 

This includes:

  • creation of the nested element
  • calling the setters for attributes
  • adding the element to the container object
  • adding a reference to the element (if id attribute is given)
Throws
\ExpatParseException

if the setup process fails

Arguments

$tag

string

the tag that comes in

$attrs

array

attributes the tag carries

Gets invoked when a XML open tag occurs

startElement(string $name, array $attribs) 
inherited

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

Throws
\ExpatParseException

Arguments

$name

string

name of the XML element

$attribs

array

attributes of the XML element

Properties

Reference to the parent object that represents the parent tag of this nested element

parent : object
var

Type(s)

object

Reference to the child object that represents the child tag of this nested element

child : \UnknownElement
var

Type(s)

\UnknownElement

Reference to the parent wrapper object

parentWrapper : \RuntimeConfigurable
var

Type(s)

\RuntimeConfigurable

Reference to the child wrapper object

childWrapper : \RuntimeConfigurable
var

Type(s)

\RuntimeConfigurable

Reference to the related target object

target : \Target
var

the target instance

Type(s)

\Target

configurator

configurator : \ProjectConfigurator
var

Type(s)

\ProjectConfigurator

parentHandler

parentHandler : \AbstractHandler
inherited
var

Type(s)

\AbstractHandler

parser

parser : \AbstractSAXParser
inherited
var

Type(s)

\AbstractSAXParser