public abstract class A_CmsConfiguredHtmlParser
extends java.lang.Object
Entry point for the tag implementation (CmsJspTagParse
). The tag will
provide a valid CmsObject
and it's configuration parameter String to
subclasses of this instances. Implementations just choose the type of
I_CmsHtmlNodeVisitor
they will use for visiting the content to be
parsed.
To implement a custom class that may be used with the createVisitorInstance()
and return the desired I_CmsHtmlNodeVisitor
implementation.
限定符 | 构造器和说明 |
---|---|
protected |
A_CmsConfiguredHtmlParser()
Default constructor that initializes the internal visitor by using the abstract template
method
createVisitorInstance() . |
限定符和类型 | 方法和说明 |
---|---|
protected abstract I_CmsHtmlNodeVisitor |
createVisitorInstance()
Subclasses have to create their desired instance for parsing the html here.
|
java.lang.String |
doParse(java.lang.String html,
java.lang.String encoding,
java.util.List<java.lang.String> noAutoCloseTags)
Returns the result of subsequent parsing to the <cms:parse< tag implementation.
|
protected CmsObject |
getCmsObject()
Returns the internal cms object for accessing core functionality.
|
protected java.lang.String |
getParam()
Returns the param.
|
protected I_CmsHtmlNodeVisitor |
getVisitor()
Returns the visitor.
|
void |
setCmsObject(CmsObject cmsObject)
Sets the internal cms object for accessing core functionality.
|
void |
setParam(java.lang.String param)
The attribute value of the attribute param of the <cms:parse> tag.
|
protected A_CmsConfiguredHtmlParser()
createVisitorInstance()
.protected abstract I_CmsHtmlNodeVisitor createVisitorInstance() throws CmsException
You have access to getCmsObject()
and getParam()
already here and may pass those to
the visitor to return.
CmsException
- if sth. goes wrongpublic java.lang.String doParse(java.lang.String html, java.lang.String encoding, java.util.List<java.lang.String> noAutoCloseTags) throws org.htmlparser.util.ParserException, CmsException
encoding
- the encoding to use for parsinghtml
- the html content to parsenoAutoCloseTags
- a list of upper case tag names for which parsing / visiting should not correct missing closing tags.org.htmlparser.util.ParserException
- if something goes wrong at parsingCmsException
- if something goes wrong at accessing OpenCms core functionalityprotected CmsObject getCmsObject()
This value will be initialized by the <cms:parse> tag.
protected java.lang.String getParam()
protected I_CmsHtmlNodeVisitor getVisitor()
public void setCmsObject(CmsObject cmsObject)
This will be invokde by the &tl;cms:parse> tag implementation.
cmsObject
- the internal cms object for accessing core functionality to setpublic void setParam(java.lang.String param)
Will be set by the <cms:parse> implementation.
param
- the param to set