Class JsoupHtmlParser
java.lang.Object
com.itextpdf.styledxmlparser.node.impl.jsoup.JsoupHtmlParser
- All Implemented Interfaces:
IXmlParser
Class that uses JSoup to parse HTML.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse
(InputStream htmlStream, String charset) Parses XML provided as anInputStream
and an encoding.Parses XML provided as aString
.private INode
wrapJsoupHierarchy
(Node jsoupNode) Wraps JSoup nodes into pdfHTMLINode
classes.
-
Field Details
-
logger
private static org.slf4j.Logger loggerThe logger.
-
-
Constructor Details
-
JsoupHtmlParser
public JsoupHtmlParser()
-
-
Method Details
-
parse
Description copied from interface:IXmlParser
Parses XML provided as anInputStream
and an encoding.- Specified by:
parse
in interfaceIXmlParser
- Parameters:
htmlStream
- the Xml streamcharset
- the character set. Ifnull
then parser should detect encoding from stream.- Returns:
- a document node
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
parse
Description copied from interface:IXmlParser
Parses XML provided as aString
.- Specified by:
parse
in interfaceIXmlParser
- Parameters:
html
- the Xml string- Returns:
- a document node
-
wrapJsoupHierarchy
Wraps JSoup nodes into pdfHTMLINode
classes.- Parameters:
jsoupNode
- the JSoup node instance- Returns:
- the
INode
instance
-