All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class xm.xm_XmlEngine

java.lang.Object
   |
   +----xm.xm_XmlEngine

public abstract class xm_XmlEngine
extends Object
Base class for an engine for processing an XML source. Given the name of an XML file, initiate the parsing of it, and return a tree of xg_Node-derived classes representing it. The root xg_Node will currently always be an xg_Document, but xg_Node is used so that in future we may be able to parse partial documents.


Variable Index

 o EngineAttList
List of configuration attributes for this engine.
 o SourceReader
The origin of the XML source being parsed.
 o StatusMessage
A textual explanation of the most recent parse status.
 o ValidateFlag
Flag to specify whether the document should be validated (if a validating parser is being used).
 o VerifyFlag
Flag to specify whether the document should be verified (if a parser supporting verification is being used).

Constructor Index

 o xm_XmlEngine()
Constructor.

Method Index

 o getAttList()
Get this engine's attributes.
 o getParseStatsText(long)
Prepare and return a string describing how much was parsed, and how fast.
 o getStatusMessage()
Get a text message explaining the last status message which was set.
 o getValidateFlag()
Get the flag to control whether to validate the document.
 o getVerifyFlag()
Get the flag to control whether to verify the document.
 o parseFile(String)
Parse the file represented by InputFileName.
 o parseFile(String, xg_Document)
Parse the file represented by InputFileName.
 o parseSource(Reader, xg_Document)
Parse the source supplied by the InputSourceReader.
 o parseString(String)
Parse an XML source which is held in string InputSourceString.
 o parseString(String, xg_Document)
Parse an XML source which is held in string InputSourceString.
 o setAttList(xg_AttList)
Give this engine a set of attributes.
 o setParseListener(xm_ParseListener)
Set the parse listener which is to be informed of parse events.
 o setValidateFlag(boolean)
Set the flag to control whether to validate the document.
 o setVerifyFlag(boolean)
Set the flag to control whether to verify the document.

Variables

 o EngineAttList
 protected xg_AttList EngineAttList
List of configuration attributes for this engine. This is typically loaded from a configuration file (although the way it is set up is of no concern to us).

 o SourceReader
 protected Reader SourceReader
The origin of the XML source being parsed.

 o ValidateFlag
 protected boolean ValidateFlag
Flag to specify whether the document should be validated (if a validating parser is being used).

 o VerifyFlag
 protected boolean VerifyFlag
Flag to specify whether the document should be verified (if a parser supporting verification is being used).

 o StatusMessage
 protected String StatusMessage
A textual explanation of the most recent parse status.

Constructors

 o xm_XmlEngine
 public xm_XmlEngine()
Constructor.

Methods

 o parseFile
 public xg_Node parseFile(String InputFileName) throws xm_ParseException, IOException
Parse the file represented by InputFileName.

Parameters:
InputFileName - Name of XML file to process
Returns:
The xg_Node representing the document parsed
Throws: xm_ParseException
The XML source contains an error
Throws: IOException
An error occurred reading from named file
 o parseFile
 public xg_Node parseFile(String InputFileName,
                          xg_Document OutputDocument) throws xm_ParseException, IOException
Parse the file represented by InputFileName.

Parameters:
InputFileName - Name of XML file to process.
OutputDocument - Document into which to place the parse results
Returns:
The xg_Node representing the specification
Throws: xm_ParseException
The XML source contains an error
Throws: IOException
An error occurred reading from named file
 o parseString
 public xg_Node parseString(String InputSourceString) throws xm_ParseException, IOException
Parse an XML source which is held in string InputSourceString.

Parameters:
InputSourceString - The source itself - as a string
Returns:
The xg_Node representing the specification
Throws: xm_ParseException
The XML source contains an error
Throws: IOException
An error occurred reading from InputSourceString
 o parseString
 public xg_Node parseString(String InputSourceString,
                            xg_Document OutputDocument) throws xm_ParseException, IOException
Parse an XML source which is held in string InputSourceString.

Parameters:
InputSourceString - The source itself - as a string
OutputDocument - Document into which to place the parse results
Returns:
The xg_Node representing the specification
Throws: xm_ParseException
The XML source contains an error
Throws: IOException
An error occurred reading from InputSourceString
 o parseSource
 public abstract xg_Node parseSource(Reader InputSourceReader,
                                     xg_Document OutputDocument) throws xm_ParseException, IOException
Parse the source supplied by the InputSourceReader.

Parameters:
InputSourceReader - The reader from which to read the XML source
OutputDocument - Document into which to place the parse results
Returns:
The xg_Node representing the parse results
Throws: xm_ParseException
The XML source contains an error
Throws: IOException
An error occurred reading from InputSourceReader
 o getParseStatsText
 protected abstract String getParseStatsText(long InputParseStartTime)
Prepare and return a string describing how much was parsed, and how fast. This method is private because it uses the current time as the time at which the parse is deemed to have completed - so if called from outside later, a misleading result will be given.

Parameters:
InputParseStartTime - The system time at which the parse started
Returns:
A string description of the parse statistics
 o setParseListener
 public void setParseListener(xm_ParseListener InputParseListener)
Set the parse listener which is to be informed of parse events.

 o setAttList
 public void setAttList(xg_AttList InputAttList)
Give this engine a set of attributes. The way in which these attributes are used (and, indeed, whether any of them are) is entirely up to a specific engine implementation (ie. derived class).

Parameters:
InputAttList - A list of attributes associated with this engine.
 o setValidateFlag
 public void setValidateFlag(boolean InputValidateFlag)
Set the flag to control whether to validate the document.

Parameters:
InputValidateFlag - true means validate; false means do not.
 o setVerifyFlag
 public void setVerifyFlag(boolean InputVerifyFlag)
Set the flag to control whether to verify the document.

Parameters:
InputVerifyFlag - true means verify; false means do not.
 o getAttList
 public xg_AttList getAttList()
Get this engine's attributes.

Returns:
A list of attributes associated with this engine.
 o getValidateFlag
 public boolean getValidateFlag()
Get the flag to control whether to validate the document.

Returns:
true means validate; false means do not.
 o getVerifyFlag
 public boolean getVerifyFlag()
Get the flag to control whether to verify the document.

Returns:
true means verify; false means do not.
 o getStatusMessage
 public String getStatusMessage()
Get a text message explaining the last status message which was set.

Returns:
The last status message

All Packages  Class Hierarchy  This Package  Previous  Next  Index