org.opencms.workplace.tools.content
public final class CmsTagReplaceParser extends org.opencms.util.CmsHtmlParser
CmsTagReplaceSettings
instance.
Instances are reusable.
| Constructor and Description |
|---|
CmsTagReplaceParser(CmsTagReplaceSettings settings)
Default constructor that turns echo on and uses the settings for replacing tags.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getTagHtml(org.htmlparser.Tag tag)
Overridden to also return the attributes of the Tag.
|
boolean |
isChangedContent()
Returns the changedContent.
|
java.lang.String |
process(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) |
void |
visitTag(org.htmlparser.Tag tag) |
collapse, configureNoAutoCorrectionTags, getConfiguration, getNoAutoCloseTags, getResult, setConfiguration, setNoAutoCloseTags, visitRemarkNode, visitStringNodepublic CmsTagReplaceParser(CmsTagReplaceSettings settings)
settings - the settings to use for tag replacement.public java.lang.String getTagHtml(org.htmlparser.Tag tag)
getTagHtml in class org.opencms.util.CmsHtmlParserCmsHtmlParser.getTagHtml(org.htmlparser.Tag)public java.lang.String process(java.lang.String html,
java.lang.String encoding)
throws org.htmlparser.util.ParserException
Additionally tags are replaced / removed according to the configuration of this instance.
process in interface org.opencms.util.I_CmsHtmlNodeVisitorprocess in class org.opencms.util.CmsHtmlParserhtml - the content to extract the plain text from.encoding - the encoding to use.org.htmlparser.util.ParserException - if something goes wrong.public void visitEndTag(org.htmlparser.Tag tag)
visitEndTag in interface org.opencms.util.I_CmsHtmlNodeVisitorvisitEndTag in class org.opencms.util.CmsHtmlParserCmsHtmlParser.visitEndTag(org.htmlparser.Tag)public void visitTag(org.htmlparser.Tag tag)
visitTag in interface org.opencms.util.I_CmsHtmlNodeVisitorvisitTag in class org.opencms.util.CmsHtmlParserCmsHtmlParser.visitTag(org.htmlparser.Tag)public boolean isChangedContent()