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, visitRemarkNode
public 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_CmsHtmlNodeVisitor
visitEndTag
in interface I_CmsHtmlNodeVisitor
visitEndTag
in class CmsHtmlParser
tag
- the tag that is ended.NodeVisitor.visitEndTag(org.htmlparser.Tag)
public void visitStringNode(org.htmlparser.Text text)
I_CmsHtmlNodeVisitor
visitStringNode
in interface I_CmsHtmlNodeVisitor
visitStringNode
in class CmsHtmlParser
text
- the text that is visited.NodeVisitor.visitStringNode(org.htmlparser.Text)
public void visitTag(org.htmlparser.Tag tag)
I_CmsHtmlNodeVisitor
visitTag
in interface I_CmsHtmlNodeVisitor
visitTag
in class CmsHtmlParser
tag
- the tag that is visited.NodeVisitor.visitTag(org.htmlparser.Tag)