Package net.sourceforge.jeuclid.parser
Class Parser
java.lang.Object
net.sourceforge.jeuclid.parser.Parser
A JAXP compatible approach to MathML Parsing.
- Version:
- $Revision: 5a7becda9147 $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve a DocumentBuilder suitable for MathML parsing.static ParserRetrieve the singleton Parser instance.static ParserDeprecated.Extract the top Node from a given Source.parseStreamSource(StreamSource streamSource) Parse a StreamSource and return its Document.parseStreamSourceAsOdf(StreamSource streamSource) Parse a given StreamSource which represents an ODF document.parseStreamSourceAsXml(StreamSource streamSource) Parse a given StreamSource which represents an XML document.
-
Constructor Details
-
Parser
protected Parser()Default constructor.
-
-
Method Details
-
getInstance
Retrieve the singleton Parser instance.- Returns:
- a Parser object.
-
getParser
Deprecated.usegetInstance()instead.usegetInstance()instead.- Returns:
- see
getInstance() - Throws:
ParserConfigurationException- seegetInstance()
-
parseStreamSource
Parse a StreamSource and return its Document.This method will auto-detect ODF or XML format and load an appropriate parser.
- Parameters:
streamSource- A StreamSource.- Returns:
- A DOM Document representation for this source.
- Throws:
SAXException- if a parse error occurred.IOException- if an I/O error occurred.
-
parseStreamSourceAsOdf
Parse a given StreamSource which represents an ODF document.- Parameters:
streamSource- StreamSource to parse.- Returns:
- the Document contained within.
- Throws:
SAXException- if a parse error occurred.IOException- if an I/O error occurred.
-
parseStreamSourceAsXml
Parse a given StreamSource which represents an XML document.- Parameters:
streamSource- StreamSource to parse.- Returns:
- the Document contained within.
- Throws:
SAXException- if a parse error occurred.IOException- if an I/O error occurred.
-
getDocumentBuilder
Retrieve a DocumentBuilder suitable for MathML parsing.Please note:
- There is one instance of the builder per thread.
- The builder instance is not thread safe, so it may not be passed among threads.
- Multiple Threads may call getDocumentBuilder concurrently
- Returns:
- a DocumentBuilder
-
parse
Extract the top Node from a given Source.- Parameters:
source- the Source to use. Currently supported areDOMSource,StreamSource- Returns:
- the top NODE.
- Throws:
SAXException- if a parse error occurred.IOException- if an I/O error occurred.
-
getInstance()instead.