|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjd.xml.xpath.model.ModelReader
A ModelReader is used to create a XPath model from an input source.
Internally it uses a ParseHandler and a ModelBuilder to construct the document. Therefore the ModelReader is independent of the parsing technique (SAX, pull, etc.) and the concrete XPath model implementation.
Constructor Summary | |
ModelReader()
Create a ModelReader with a default parser. |
|
ModelReader(Object parser)
Create a ModelReader. |
Method Summary | |
void |
collectLineNumbers(boolean mode)
Specifies that the a line number map is created when documents are parsed. |
ParseHandler |
getParseHandler()
Return the parse handler. |
XPathRootNode |
getTextNodeFragment(String text,
NodeNamePool nodeNamePool)
Return a text node fragment, i.e. |
XPathRootNode |
read(String uri)
Read a xml document. |
XPathRootNode |
read(XmlSource source)
Read a xml document. |
XPathRootNode |
read(XmlSource source,
NodeNamePool nodeNamePool)
Read a xml document. |
void |
setModelBuilder(ModelBuilder modelBuilder)
|
void |
setNextDocumentId(int id)
Set the document id for the next document. |
void |
setParser(Object parser)
Set a new parser object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ModelReader() throws SAXException
public ModelReader(Object parser) throws SAXException
parser
- a Sax1, Sax2 or a pull parser or null if a default parser
should be used.
SAXException
- thrown if the parser is invalid
or cannot be initializedMethod Detail |
public void setParser(Object parser) throws SAXException
parser
- a Sax1, Sax2 or a pull parser.
SAXException
- thrown if the parser is invalid
or cannot be initialized
SAXException
- thrown if the parser cannot be initializedpublic ParseHandler getParseHandler()
public void setModelBuilder(ModelBuilder modelBuilder)
public void setNextDocumentId(int id)
public void collectLineNumbers(boolean mode)
XPathNode.getLineNumber()
public XPathRootNode read(String uri) throws IOException, SAXException
uri
- the uri of a document
IOException
SAXException
public XPathRootNode read(XmlSource source) throws IOException, SAXException
source
- the document source.
IOException
SAXException
public XPathRootNode read(XmlSource source, NodeNamePool nodeNamePool) throws IOException, SAXException, XPathException
source
- the document source.nodeNamePool
- the name of the document pool, or null if a new
name pool should be used
IOException
SAXException
XPathException
public XPathRootNode getTextNodeFragment(String text, NodeNamePool nodeNamePool)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |