|
||||||||||
| 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
public class CmsLinkProcessor
Implements the HTML parser node visitor pattern to exchange all links on the page.
| Field Summary | |
|---|---|
static String |
HTML_END
HTML end. |
static 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,
String encoding,
String relativePath)
Creates a new link processor. |
|
| Method Summary | |
|---|---|
static String |
escapeLink(String source)
Escapes all &, e.g. |
CmsLinkTable |
getLinkTable()
Returns the link table this link processor was initialized with. |
protected void |
processImageTag(ImageTag tag)
Process an image tag. |
String |
processLinks(String content)
Starts link processing for the given content in processing mode. |
protected void |
processLinkTag(LinkTag tag)
Process a link tag. |
String |
replaceLinks(String content)
Starts link processing for the given content in replacement mode. |
static String |
unescapeLink(String source)
Unescapes all &, that is replaces them with a &. |
void |
visitTag(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 String HTML_END
public static final String HTML_START
| Constructor Detail |
|---|
public CmsLinkProcessor(CmsObject cms,
CmsLinkTable linkTable,
String encoding,
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 String escapeLink(String source)
&, e.g. replaces them with a &.
source - the String to escape
public static String unescapeLink(String source)
&, that is replaces them with a &.
source - the String to unescape
public CmsLinkTable getLinkTable()
public String processLinks(String content)
throws ParserException
Macros are replaced by links.
content - the content to process
ParserException - if something goes wrong
public String replaceLinks(String content)
throws ParserException
Links are replaced by macros.
content - the content to process
ParserException - if something goes wrongpublic void visitTag(Tag tag)
visitTag in interface I_CmsHtmlNodeVisitorvisitTag in class CmsHtmlParsertag - the tag to processI_CmsHtmlNodeVisitor.visitTag(org.htmlparser.Tag)protected void processImageTag(ImageTag tag)
tag - the tag to processprotected void processLinkTag(LinkTag tag)
tag - the tag to process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||