Package de.hybris.bootstrap.xml
Class Parser
java.lang.Object
de.hybris.bootstrap.xml.Parser
- Direct Known Subclasses:
ConfigurationParser,HybrisTypeSystemParser
The xml parser class. Using it simply requires to provide a root
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected XMLContentHandlercreateHandler(TagListener root) protected final SAXParsercreateSaxParser(Map props) protected TagListenerprotected Mapprotected ObjectProcessorprotected SAXParservoidparse(InputStream stream, String encoding, TagListener root) Parses a given input source using the given root tag listener.voidparse(InputSource src, TagListener root) Parses a given input source using the given root tag listener.protected voidsetFeatures(Map props)
-
Constructor Details
-
Parser
-
-
Method Details
-
getSaxParser
-
getCurrentTagListener
-
getObjectProcessor
-
createSaxParser
-
setFeatures
-
getDefaultFeatures
-
createHandler
-
parse
Parses a given input source using the given root tag listener.This method accepts a data stream together with its encoding. It automatically wraps it into a
UnicodeInputStreamto work around the current utf-8 bom bug of the java vm.- Parameters:
stream- the data top parseencoding- encoding of dataroot- the root tag listener to call upon parsing- Throws:
ParseAbortException- in case of an parse error
-
parse
Parses a given input source using the given root tag listener.- Parameters:
src- the data top parseroot- the root tag listener to call upon parsing- Throws:
ParseAbortException- in case of an parse error- See Also:
-