Class JsoupHtmlParser
- java.lang.Object
-
- com.itextpdf.styledxmlparser.node.impl.jsoup.JsoupHtmlParser
-
- All Implemented Interfaces:
IXmlParser
public class JsoupHtmlParser extends java.lang.Object implements IXmlParser
Class that uses JSoup to parse HTML.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerloggerThe logger.
-
Constructor Summary
Constructors Constructor Description JsoupHtmlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDocumentNodeparse(java.io.InputStream htmlStream, java.lang.String charset)Parses XML provided as anInputStreamand an encoding.IDocumentNodeparse(java.lang.String html)Parses XML provided as aString.private INodewrapJsoupHierarchy(Node jsoupNode)Wraps JSoup nodes into pdfHTMLINodeclasses.
-
-
-
Method Detail
-
parse
public IDocumentNode parse(java.io.InputStream htmlStream, java.lang.String charset) throws java.io.IOException
Description copied from interface:IXmlParserParses XML provided as anInputStreamand an encoding.- Specified by:
parsein interfaceIXmlParser- Parameters:
htmlStream- the Xml streamcharset- the character set. Ifnullthen parser should detect encoding from stream.- Returns:
- a document node
- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
parse
public IDocumentNode parse(java.lang.String html)
Description copied from interface:IXmlParserParses XML provided as aString.- Specified by:
parsein interfaceIXmlParser- Parameters:
html- the Xml string- Returns:
- a document node
-
-