Enhydra 5.1 API

org.w3c.tidy
Interface NodeHandler


public interface NodeHandler

Abstract method to provide facilities for viewing each node as it is parsed by tidy and for prepending dynamic content before any bytes read off the standard tidy input stream. An implementation of this interface registers itself with JTidy by calling NodeHandlerStore.getInstance().addNewHandler(this);

Since:
2/20/02
Author:
Ryan Breen (ryan@porivo.com)

Method Summary
 int getDynamicContent()
          Allows the implementing object to prepend an input stream in front of the current buffer being parsed by Tidy.
 Node handleNode(Node element, Node node)
          Handle the passed in Node and parent element and return a modified Node.
 

Method Detail

handleNode

public Node handleNode(Node element,
                       Node node)
Handle the passed in Node and parent element and return a modified Node. Calls to this method are made from Tidy with each call to Node.insertNodeAtEnd, passing in the node and the element to which the node will be appended.

Parameters:
element - The element passed into a call to Node.insertNodeAtEnd. This represents the parent element of the node parameter as it is the element to which the node will be appended.
node - New child node parsed from the document and about to be appended to the parent element.
Returns:
The child node, potentially modified by the implementing object.

getDynamicContent

public int getDynamicContent()
                      throws java.io.IOException
Allows the implementing object to prepend an input stream in front of the current buffer being parsed by Tidy. Calls to this method are made by StreamInImpl before reading new bytes off of the standard input stream. This method is useful for extending JTidy to parse dynamic content.

Returns:
The first character of dynamic content or -1 none exists.
java.io.IOException

Enhydra 5.1 API