public class CmsHtml2TextConverter extends CmsHtmlParser
m_echo, m_noAutoCloseTags, m_result, TAG_ARRAY, TAG_LIST| 构造器和说明 |
|---|
CmsHtml2TextConverter()
Creates a new instance of the html converter.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 I_CmsHtmlNodeVisitorvisitEndTag 在类中 CmsHtmlParsertag - the tag that is ended.NodeVisitor.visitEndTag(org.htmlparser.Tag)public void visitStringNode(org.htmlparser.Text text)
I_CmsHtmlNodeVisitorvisitStringNode 在接口中 I_CmsHtmlNodeVisitorvisitStringNode 在类中 CmsHtmlParsertext - the text that is visited.NodeVisitor.visitStringNode(org.htmlparser.Text)public void visitTag(org.htmlparser.Tag tag)
I_CmsHtmlNodeVisitorvisitTag 在接口中 I_CmsHtmlNodeVisitorvisitTag 在类中 CmsHtmlParsertag - the tag that is visited.NodeVisitor.visitTag(org.htmlparser.Tag)