|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.htmlparser.visitors.NodeVisitor
org.opencms.util.CmsHtmlParser
org.opencms.staticexport.CmsLinkProcessor
Implements the HTML parser node visitor pattern to exchange all links on the page.
Field Summary | |
static java.lang.String |
HTML_END
HTML end. |
static java.lang.String |
HTML_START
HTML start. |
Fields inherited from class org.opencms.util.CmsHtmlParser |
m_echo, m_result, TAG_ARRAY, TAG_LIST |
Constructor Summary | |
CmsLinkProcessor(CmsObject cms,
CmsLinkTable linkTable,
java.lang.String encoding,
java.lang.String relativePath)
Creates a new link processor. |
Method Summary | |
static java.lang.String |
escapeLink(java.lang.String source)
Escapes all & , e.g. replaces them with a & . |
CmsLinkTable |
getLinkTable()
Returns the link table this link processor was initialized with. |
protected void |
processImageTag(org.htmlparser.tags.ImageTag tag)
Process an image tag. |
java.lang.String |
processLinks(java.lang.String content)
Starts link processing for the given content in processing mode. |
protected void |
processLinkTag(org.htmlparser.tags.LinkTag tag)
Process a link tag. |
java.lang.String |
replaceLinks(java.lang.String content)
Starts link processing for the given content in replacement mode. |
static java.lang.String |
unescapeLink(java.lang.String source)
Unescapes all & , that is replaces them with a & . |
void |
visitTag(org.htmlparser.Tag tag)
Visitor method to process a tag (start). |
Methods inherited from class org.opencms.util.CmsHtmlParser |
collapse, getConfiguration, getResult, getTagHtml, process, process, setConfiguration, visitEndTag, visitRemarkNode, visitStringNode |
Methods inherited from class org.htmlparser.visitors.NodeVisitor |
beginParsing, finishedParsing, shouldRecurseChildren, shouldRecurseSelf |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String HTML_END
public static final java.lang.String HTML_START
Constructor Detail |
public CmsLinkProcessor(CmsObject cms, CmsLinkTable linkTable, java.lang.String encoding, java.lang.String relativePath)
cms
- the cms objectlinkTable
- the link table to useencoding
- the encoding to use for parsing the HTML contentrelativePath
- additional path for links with relative path (only used in "replace" mode)Method Detail |
public static java.lang.String escapeLink(java.lang.String source)
&
, e.g. replaces them with a &
.
source
- the String to escape
public static java.lang.String unescapeLink(java.lang.String source)
&
, that is replaces them with a &
.
source
- the String to unescape
public CmsLinkTable getLinkTable()
public java.lang.String processLinks(java.lang.String content) throws org.htmlparser.util.ParserException
Macros are replaced by links.
content
- the content to process
org.htmlparser.util.ParserException
- if something goes wrongpublic java.lang.String replaceLinks(java.lang.String content) throws org.htmlparser.util.ParserException
Links are replaced by macros.
content
- the content to process
org.htmlparser.util.ParserException
- if something goes wrongpublic void visitTag(org.htmlparser.Tag tag)
visitTag
in interface I_CmsHtmlNodeVisitor
visitTag
in class CmsHtmlParser
tag
- the tag to processI_CmsHtmlNodeVisitor.visitTag(org.htmlparser.Tag)
protected void processImageTag(org.htmlparser.tags.ImageTag tag)
tag
- the tag to processprotected void processLinkTag(org.htmlparser.tags.LinkTag tag)
tag
- the tag to process
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |