HTML Parser Home Page

org.htmlparser.lexer.nodes
Interface NodeFactory

All Known Implementing Classes:
Lexer, PrototypicalNodeFactory

public interface NodeFactory

This interface defines the methods needed to create new nodes. The factory is used when lexing to generate the nodes passed back to the caller.


Method Summary
 Node createRemarkNode(Page page, int start, int end)
          Create a new remark node.
 Node createStringNode(Page page, int start, int end)
          Create a new string node.
 Node createTagNode(Page page, int start, int end, Vector attributes)
          Create a new tag node.
 

Method Detail

createStringNode

public Node createStringNode(Page page,
                             int start,
                             int end)
                      throws ParserException
Create a new string node.

Parameters:
page - The page the node is on.
start - The beginning position of the string.
end - The ending positiong of the string.
Throws:
ParserException

createRemarkNode

public Node createRemarkNode(Page page,
                             int start,
                             int end)
                      throws ParserException
Create a new remark node.

Parameters:
page - The page the node is on.
start - The beginning position of the remark.
end - The ending positiong of the remark.
Throws:
ParserException

createTagNode

public Node createTagNode(Page page,
                          int start,
                          int end,
                          Vector attributes)
                   throws ParserException
Create a new tag node. Note that the attributes vector contains at least one element, which is the tag name (standalone attribute) at position zero. This can be used to decide which type of node to create, or gate other processing that may be appropriate.

Parameters:
page - The page the node is on.
start - The beginning position of the tag.
end - The ending positiong of the tag.
attributes - The attributes contained in this tag.
Throws:
ParserException

© 2004 Somik Raha
Mar 14, 2004

HTML Parser is an open source library released under LGPL.
SourceForge.net