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.Logger
logger
The logger.
-
Constructor Summary
Constructors Constructor Description JsoupHtmlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDocumentNode
parse(java.io.InputStream htmlStream, java.lang.String charset)
Parses XML provided as anInputStream
and an encoding.IDocumentNode
parse(java.lang.String html)
Parses XML provided as aString
.private INode
wrapJsoupHierarchy(Node jsoupNode)
Wraps JSoup nodes into pdfHTMLINode
classes.
-
-
-
Method Detail
-
parse
public IDocumentNode parse(java.io.InputStream htmlStream, java.lang.String charset) throws java.io.IOException
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:
java.io.IOException
- Signals that an I/O exception has occurred.
-
parse
public IDocumentNode parse(java.lang.String html)
Description copied from interface:IXmlParser
Parses XML provided as aString
.- Specified by:
parse
in interfaceIXmlParser
- Parameters:
html
- the Xml string- Returns:
- a document node
-
-