public class CmsHtml2TextConverter extends CmsHtmlParser
m_echo, m_noAutoCloseTags, m_result, TAG_ARRAY, TAG_LIST| Constructor and Description |
|---|
CmsHtml2TextConverter()
Creates a new instance of the html converter.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
html2text(java.lang.String html,
java.lang.String encoding)
Extracts the text from the given html content, assuming the given html encoding.
|
void |
visitEndTag(org.htmlparser.Tag tag)
Visitor method (callback) invoked when a closing Tag is encountered.
|
void |
visitStringNode(org.htmlparser.Text text)
Visitor method (callback) invoked when a remark Tag (HTML comment) is encountered.
|
void |
visitTag(org.htmlparser.Tag tag)
Visitor method (callback) invoked when a starting Tag (HTML comment) is encountered.
|
collapse, configureNoAutoCorrectionTags, getConfiguration, getNoAutoCloseTags, getResult, getTagHtml, process, setConfiguration, setNoAutoCloseTags, visitRemarkNodepublic CmsHtml2TextConverter()
public static java.lang.String html2text(java.lang.String html, java.lang.String encoding) throws java.lang.Exception
html - the content to extract the plain text fromencoding - the encoding to usejava.lang.Exception - if something goes wrongpublic void visitEndTag(org.htmlparser.Tag tag)
I_CmsHtmlNodeVisitorvisitEndTag in interface I_CmsHtmlNodeVisitorvisitEndTag in class CmsHtmlParsertag - the tag that is ended.NodeVisitor.visitEndTag(org.htmlparser.Tag)public void visitStringNode(org.htmlparser.Text text)
I_CmsHtmlNodeVisitorvisitStringNode in interface I_CmsHtmlNodeVisitorvisitStringNode in class CmsHtmlParsertext - the text that is visited.NodeVisitor.visitStringNode(org.htmlparser.Text)public void visitTag(org.htmlparser.Tag tag)
I_CmsHtmlNodeVisitorvisitTag in interface I_CmsHtmlNodeVisitorvisitTag in class CmsHtmlParsertag - the tag that is visited.NodeVisitor.visitTag(org.htmlparser.Tag)