## Apache Zeta Components Manual :: Docs For Class ezcDocumentWikiVisitor

### Document::ezcDocumentWikiVisitor

### Class ezcDocumentWikiVisitor

Abstract visitor base for Wiki documents represented by the parser AST.

Source for this file: /Document/src/document/wiki/visitor.php

### Implements interfaces:

- ezcDocumentErrorReporting

Version: | //autogen//

### Descendants

Child Class | Description
--- | ---
ezcDocumentWikiDocbookVisitor | Docbook visitor for the Wiki AST.

### Member Variables

protected ezcDocumentWikiDocumentNode | `$ast` Reference to the AST root node.
protected array | `$errors = array()` Aggregated minor errors during document processing.
protected array | `$footnoteCounter = 0` Label dependant foot note counters for footnote auto enumeration.
protected array | `$footnotes = array()` List with footnotes for later rendering.
protected ezcDocumentWiki | `$wiki` Wiki document handler

### Method Summary

public void | `__construct( $document , $path )` Create visitor from Wiki document handler.
protected void | `addFootnote( $node )` Add footnote
public array | `getErrors( )` Return list of errors occured during visiting the document.
public ezcDocumentWikiFootnoteNode | `hasFootnoteTarget( $number , $node )` Check for internal footnote reference target
protected string | `nodeListToString( $nodes )` Node list to string
protected string | `nodeToString( $node )` Transform a node tree into a string
protected void | `preProcessAst( $node )` Pre process AST
public void | `triggerError( $level , $message , [ $file = null] , [ $line = null] , [ $position = null] )` Trigger visitor error
public mixed | `visit( $ast )` Docarate Wiki AST
protected void | `visitChildren( $root , $node )` Visit children
protected void | `visitText( $root , $node )` Visit text node

### Methods

#### __construct

void __construct( ezcDocumentWiki $document , string $path )

Create visitor from Wiki document handler.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$document` | ezcDocumentWiki |
`$path` | string |

#### addFootnote

void addFootnote( ezcDocumentWikiNode $node )

Add footnote

##### Parameters:

Name | Type | Description
--- | --- | ---
`$node` | ezcDocumentWikiNode |

#### getErrors

array getErrors( )

Return list of errors occured during visiting the document.

May be an empty array, if on errors occured, or a list of ezcDocumentVisitException objects.

##### Implementation of:

Method | Description
--- | ---
`ezcDocumentErrorReporting::getErrors()` | Return list of errors occured during visiting the document.

#### hasFootnoteTarget

ezcDocumentWikiFootnoteNode hasFootnoteTarget( int $number , ezcDocumentWikiNode $node )

Check for internal footnote reference target

Returns the target name, when an internal reference target exists and sets it to used, and false otherwise.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$number` | int |
`$node` | ezcDocumentWikiNode |

#### nodeListToString

string nodeListToString( $nodes )

Node list to string

Extract the contents of a node list and return a single string for the array of nodes.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$nodes` | array |

#### nodeToString

string nodeToString( ezcDocumentWikiNode $node )

Transform a node tree into a string

Transform a node tree, with all its subnodes into a string by only getting the textuual contents from ezcDocumentWikiTextLineNode objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$node` | ezcDocumentWikiNode |

#### preProcessAst

void preProcessAst( ezcDocumentWikiNode $node )

Pre process AST

Performs multiple preprocessing steps on the AST:

Collect all possible reference targets in the AST to know the actual destianation for references while decorating. The references are stored in an internal structure and you may request the actual link by using the getReferenceTarget() method.

Aggregate list items into lists. In Wiki there are only list items, which are aggregated to lists depending on their bullet type. The related list items are aggregated into one list.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$node` | ezcDocumentWikiNode |

#### triggerError

void triggerError( int $level , string $message , [string $file = null] , [int $line = null] , [int $position = null] )

Trigger visitor error

Emit a vistitor error, and convert it to an exception depending on the error reporting settings.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$level` | int |
`$message` | string |
`$file` | string |
`$line` | int |
`$position` | int |

##### Implementation of:

Method | Description
--- | ---
`ezcDocumentErrorReporting::triggerError()` | Trigger parser error.

#### visit

mixed visit( ezcDocumentWikiDocumentNode $ast )

Docarate Wiki AST

Visit the Wiki abstract syntax tree.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$ast` | ezcDocumentWikiDocumentNode |

##### Redefined in descendants as:

Method | Description
--- | ---
`ezcDocumentWikiDocbookVisitor::visit()` | Docarate Wiki AST

#### visitChildren

void visitChildren( $root , ezcDocumentWikiNode $node )

Visit children

Just recurse into node and visit its children, ignoring the actual node.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$root` | DOMNode |
`$node` | ezcDocumentWikiNode |

#### visitText

void visitText( $root , ezcDocumentWikiNode $node )

Visit text node

##### Parameters:

Name | Type | Description
--- | --- | ---
`$root` | DOMNode |
`$node` | ezcDocumentWikiNode |

Documentation generated by phpDocumentor 1.4.3