public class Parser extends Object
TagListener and a
{link org.xml.sax.InputSource}.
Example:
Media m = ...
Parser p = new Parser();
try
{
p.parse(
new InputSource( m.getDataFromStream() ),
new MyRootTagListener()
);
}
catch( ParseAbortException e )
{
// do some error handling
}
| Constructor and Description |
|---|
Parser(ObjectProcessor processor,
Map props) |
| Modifier and Type | Method and Description |
|---|---|
protected XMLContentHandler |
createHandler(TagListener root) |
protected SAXParser |
createSaxParser(Map props) |
protected TagListener |
getCurrentTagListener() |
protected Map |
getDefaultFeatures() |
protected ObjectProcessor |
getObjectProcessor() |
protected SAXParser |
getSaxParser() |
void |
parse(InputSource src,
TagListener root)
Parses a given input source using the given root tag listener.
|
void |
parse(InputStream stream,
String encoding,
TagListener root)
Parses a given input source using the given root tag listener.
|
protected void |
setFeatures(Map props) |
public Parser(ObjectProcessor processor, Map props)
protected SAXParser getSaxParser()
protected TagListener getCurrentTagListener()
protected ObjectProcessor getObjectProcessor()
protected void setFeatures(Map props)
protected Map getDefaultFeatures()
protected XMLContentHandler createHandler(TagListener root)
public void parse(InputStream stream, String encoding, TagListener root) throws ParseAbortException
This method accepts a data stream together with its encoding. It automatically wraps it into a
UnicodeInputStream to work around the current utf-8 bom bug of the java vm.
stream - the data top parseencoding - encoding of dataroot - the root tag listener to call upon parsingParseAbortException - in case of an parse errorpublic void parse(InputSource src, TagListener root) throws ParseAbortException
src - the data top parseroot - the root tag listener to call upon parsingParseAbortException - in case of an parse errorparse(InputStream, String, TagListener)Copyright © 2017 SAP SE. All Rights Reserved.