All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xe.xe_ParseManager

java.lang.Object
   |
   +----xe.xe_Tokenizer
           |
           +----xe.xe_ParseManager

public class xe_ParseManager
extends xe_Tokenizer

Perform low-level parsing of an XML source and keep the state of the current parse (by inheriting from xe_Tokenizer). Also provide access to the factory for creating parsers and manages the parse listener (if there is one).

The parsing of the different parts of an XML source are created by an xe_ParserFactory held herein. Specialised parsers can be added by registering with xe_TokenType the keywords to which they relate.


Constructor Index

 o xe_ParseManager()
Default constructor.

Method Index

 o certifyNewNode(xg_Node, xg_Node)
Add InputNewNode to its parent (hence the name of this method: we're issuing its birth certificate), and then tell the outside world about this joyous event.
 o createEntity(String, int, String, String, xg_Node)

Create an entity of the type suitable for the entity whose type is 'InputEntityName'.

 o createParser(String, int)
Create a parser suitable for parser the entity whose name is giving in InputEntityName.
 o fireEndNodeEvent(xg_Node)
Send an 'end node' event to the parse listener.
 o fireStartNodeEvent(xg_Node, int)
Send a 'start node' event to the parse listener.
 o setParseListener(xm_ParseListener)
Set the parse listener which is to be informed of parse events.

Constructors

 o xe_ParseManager
 public xe_ParseManager()
Default constructor.

Methods

 o createParser
 public xe_Parser createParser(String InputNodeName,
                               int InputNodeType) throws xm_ParseException
Create a parser suitable for parser the entity whose name is giving in InputEntityName.

Parameters:
InputNodeName - The name of the node for which we need a parser
InputNodeType - The type of node for which we need a parser
Returns:
The newly-created parser for the named entity
Throws: xm_ParseException
Either no parser class is registered or it cannot be instantiated
 o createEntity
 public xg_Node createEntity(String InputEntityName,
                             int InputNodeType,
                             String InputNodePrecedingWhitespace,
                             String InputUsualClassName,
                             xg_Node InputParentNode) throws xm_ParseException

Create an entity of the type suitable for the entity whose type is 'InputEntityName'. The entity created is guaranteed to be an instance of the class whose name is InputUsualClassName - or a derived class.

Non-standard entities can be added by registering with xe_NodeTypeRegistry the names to which they relate.

Parameters:
InputEntityName - The name of the node we to create
InputNodeType - The type of node we need to create
InputNodePrecedingWhitespace - The whitespace which precedes the new node
InputUsualClassName - The name of the class which is usually used to represent entities of this type. The class actually used must be this or a derived from it.
InputParentNode - The parent of the new entity. The newly-created entity is added as a child of this parent.
Returns:
The newly-created entity
Throws: xm_ParseException
XML wellformedness error
 o certifyNewNode
 public void certifyNewNode(xg_Node InputNewNode,
                            xg_Node InputParentNode) throws xm_ParseException
Add InputNewNode to its parent (hence the name of this method: we're issuing its birth certificate), and then tell the outside world about this joyous event.

Parameters:
InputNewNode - The new node being certified.
InputParentNode - The parent of the new node. The newly-created node is added as a child of this parent.
Throws: xm_ParseException
XML wellformedness error
 o setParseListener
 public void setParseListener(xm_ParseListener InputParseListener)
Set the parse listener which is to be informed of parse events.

 o fireStartNodeEvent
 public void fireStartNodeEvent(xg_Node InputNewNode,
                                int InputStartPosition)
Send a 'start node' event to the parse listener.

Parameters:
InputNewNode - The node whose start has just been parsed
InputStartPosition - The offset from the start of the source at which this node starts
 o fireEndNodeEvent
 public void fireEndNodeEvent(xg_Node InputNewNode) throws xm_ParseException
Send an 'end node' event to the parse listener.

Parameters:
InputNewNode - The node which has just been parsed

All Packages  Class Hierarchy  This Package  Previous  Next  Index