Class A_CmsConfiguredHtmlParser
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.
- Since:
- 6.1.7
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor that initializes the internal visitor by using the abstract template methodcreateVisitorInstance(). -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract I_CmsHtmlNodeVisitorSubclasses have to create their desired instance for parsing the html here.Returns the result of subsequent parsing to the <cms:parse< tag implementation.protected CmsObjectReturns the internal cms object for accessing core functionality.protected StringgetParam()Returns the param.protected I_CmsHtmlNodeVisitorReturns the visitor.voidsetCmsObject(CmsObject cmsObject) Sets the internal cms object for accessing core functionality.voidThe attribute value of the attribute param of the <cms:parse> tag.
-
Constructor Details
-
A_CmsConfiguredHtmlParser
protected A_CmsConfiguredHtmlParser()Default constructor that initializes the internal visitor by using the abstract template methodcreateVisitorInstance().
-
-
Method Details
-
createVisitorInstance
Subclasses have to create their desired instance for parsing the html here.You have access to
getCmsObject()andgetParam()already here and may pass those to the visitor to return.- Returns:
- the instance to be used for parsing the html
- Throws:
CmsException- if sth. goes wrong
-
doParse
public String doParse(String html, String encoding, List<String> noAutoCloseTags) throws org.htmlparser.util.ParserException, CmsException Returns the result of subsequent parsing to the <cms:parse< tag implementation.- Parameters:
html- the html content to parseencoding- the encoding to use for parsingnoAutoCloseTags- a list of upper case tag names for which parsing / visiting should not correct missing closing tags.- Returns:
- the result of subsequent parsing to the <cms:parse< tag implementation
- Throws:
org.htmlparser.util.ParserException- if something goes wrong at parsingCmsException- if something goes wrong at accessing OpenCms core functionality
-
getCmsObject
Returns the internal cms object for accessing core functionality.This value will be initialized by the <cms:parse> tag.
- Returns:
- the internal cms object for accessing core functionality
-
getParam
Returns the param.- Returns:
- the param
-
getVisitor
Returns the visitor.- Returns:
- the visitor
-
setCmsObject
Sets the internal cms object for accessing core functionality.This will be invokde by the &tl;cms:parse> tag implementation.
- Parameters:
cmsObject- the internal cms object for accessing core functionality to set
-
setParam
The attribute value of the attribute param of the <cms:parse> tag.Will be set by the <cms:parse> implementation.
- Parameters:
param- the param to set
-