# Class TreeParser

java.lang.Object
nu.validator.saxtree.TreeParser

All Implemented Interfaces:
  `Locator2, Locator`

public final class TreeParser extends Object implements Locator, Locator2
A tree visitor that replays a tree as SAX events.

Version:
  $Id$
Author:
  hsivonen

## Constructor Summary

Constructors
Constructor
Description
`TreeParser(ContentHandler contentHandler, LexicalHandler lexicalHandler)`
The constructor.

## Method Summary

Modifier and Type
Method
Description
`int`
`getColumnNumber()`
`String`
`getEncoding()`
`int`
`getLineNumber()`
`String`
`getPublicId()`
`String`
`getSystemId()`
`String`
`getXMLVersion()`
`void`
`parse(Node node)`
Causes SAX events for the tree rooted at the argument to be emitted.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TreeParser

public TreeParser(ContentHandler contentHandler, LexicalHandler lexicalHandler)
The constructor.

Parameters:
  `contentHandler` - must not be `null`
  `lexicalHandler` - may be `null`

## Method Details

### parse

public void parse(Node node) throws SAXException
Causes SAX events for the tree rooted at the argument to be emitted. `startDocument()` and `endDocument()` are only emitted for a `Document` node.

Parameters:
  `node` - the root
Throws:
  `SAXException`

### getColumnNumber

public int getColumnNumber()

Specified by:
  `getColumnNumber` in interface `Locator`
See Also:
  - `Locator.getColumnNumber()`

### getLineNumber

public int getLineNumber()

Specified by:
  `getLineNumber` in interface `Locator`
See Also:
  - `Locator.getLineNumber()`

### getPublicId

public String getPublicId()

Specified by:
  `getPublicId` in interface `Locator`
See Also:
  - `Locator.getPublicId()`

### getSystemId

public String getSystemId()

Specified by:
  `getSystemId` in interface `Locator`
See Also:
  - `Locator.getSystemId()`

### getXMLVersion

public String getXMLVersion()

Specified by:
  `getXMLVersion` in interface `Locator2`
See Also:
  - `Locator.getSystemId()`

### getEncoding

public String getEncoding()

Specified by:
  `getEncoding` in interface `Locator2`
See Also:
  - `Locator.getSystemId()`