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.
-
EngineAttList
- List of configuration attributes for this engine.
-
SourceReader
- The origin of the XML source being parsed.
-
StatusMessage
- A textual explanation of the most recent parse status.
-
ValidateFlag
- Flag to specify whether the document should be validated (if a validating
parser is being used).
-
VerifyFlag
- Flag to specify whether the document should be verified (if a parser
supporting verification is being used).
-
xm_XmlEngine()
- Constructor.
-
getAttList()
- Get this engine's attributes.
-
getParseStatsText(long)
- Prepare and return a string describing how much was parsed, and how fast.
-
getStatusMessage()
- Get a text message explaining the last status message which was set.
-
getValidateFlag()
- Get the flag to control whether to validate the document.
-
getVerifyFlag()
- Get the flag to control whether to verify the document.
-
parseFile(String)
- Parse the file represented by InputFileName.
-
parseFile(String, xg_Document)
- Parse the file represented by InputFileName.
-
parseSource(Reader, xg_Document)
- Parse the source supplied by the InputSourceReader.
-
parseString(String)
- Parse an XML source which is held in string InputSourceString.
-
parseString(String, xg_Document)
- Parse an XML source which is held in string InputSourceString.
-
setAttList(xg_AttList)
- Give this engine a set of attributes.
-
setParseListener(xm_ParseListener)
- Set the parse listener which is to be informed of parse events.
-
setValidateFlag(boolean)
- Set the flag to control whether to validate the document.
-
setVerifyFlag(boolean)
- Set the flag to control whether to verify the document.
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).
SourceReader
protected Reader SourceReader
- The origin of the XML source being parsed.
ValidateFlag
protected boolean ValidateFlag
- Flag to specify whether the document should be validated (if a validating
parser is being used).
VerifyFlag
protected boolean VerifyFlag
- Flag to specify whether the document should be verified (if a parser
supporting verification is being used).
StatusMessage
protected String StatusMessage
- A textual explanation of the most recent parse status.
xm_XmlEngine
public xm_XmlEngine()
- Constructor.
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
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
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
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
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
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
setParseListener
public void setParseListener(xm_ParseListener InputParseListener)
- Set the parse listener which is to be informed of parse events.
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.
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.
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.
getAttList
public xg_AttList getAttList()
- Get this engine's attributes.
- Returns:
- A list of attributes associated with this engine.
getValidateFlag
public boolean getValidateFlag()
- Get the flag to control whether to validate the document.
- Returns:
- true means validate; false means do not.
getVerifyFlag
public boolean getVerifyFlag()
- Get the flag to control whether to verify the document.
- Returns:
- true means verify; false means do not.
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