Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.renderer.filter.wiki
Class WikiLinkRenderer

java.lang.Object
  extended by com.jivesoftware.forum.renderer.filter.regex.RegexFilter
      extended by com.jivesoftware.forum.renderer.filter.regex.RegexTokenFilter
          extended by com.jivesoftware.forum.renderer.filter.wiki.WikiLinkRenderer
All Implemented Interfaces:
WikiRenderer

public class WikiLinkRenderer
extends RegexTokenFilter
implements WikiRenderer

Link Filter. Links can be of the following types:

[#anchor link] Creates a link to an anchor.
[^attachment.ext] Creates a link to an attachment.
[link text|^attachment.ext] Creates a link to an attachment with custom link text
[link text|^attachment.ext|A tooltip] Creates a link to an attachment with custom link text and a tooltip
[link text|f-1234|A tooltip] Creates a link to the forum with ID 1234 with custom link text and a tooltip
[link text|t-1234|A tooltip] Creates a link to the thread with ID 1234 with custom link text and a tooltip
[link text|m-1234|A tooltip] Creates a link to the message with ID 1234 with custom link text and a tooltip
[link text|m-1234^attachment.ext|A tooltip] Creates a link to the attachment 'attachment.ext'
that is attached to the message with ID 1234 using custom link text and a tooltip


Field Summary
static java.lang.String LINK_ESCAPE_MATCH_1
           
static java.lang.String LINK_ESCAPE_MATCH_2
           
static java.lang.String LINK_ESCAPE_REPLACE_1
           
static java.lang.String LINK_ESCAPE_REPLACE_2
           
static java.lang.String LINK_MATCH
           
static java.lang.String MACRO_LINK_MATCH
           
 
Fields inherited from class com.jivesoftware.forum.renderer.filter.regex.RegexFilter
MULTILINE, pattern, SINGLELINE, substitute
 
Constructor Summary
WikiLinkRenderer()
           
 
Method Summary
 java.lang.String getSchemes()
          Returns the current supported uri schemes as a comma separated string.
 void handleMatch(java.lang.StringBuffer buffer, JdkMatchResult result, RenderContext renderContext)
          Method is called for every occurnce of a regular expression.
protected  boolean isATagFilter(java.lang.String string, RenderContext renderContext)
           
 boolean isForceIDLinks()
          Returns true if all links are to be outputted as ID's.
 java.lang.String render(java.lang.String string, RenderContext renderContext, WikiFilter filter)
           
 java.util.List retrieveLinks(java.lang.String string, RenderContext renderContext)
           
 void setForceIDLinks(boolean forceIDLinks)
          Set to true to force all links to be outputted as ID's
 void setSchemes(java.lang.String schemes)
          Sets the current supported uri schemes as a comma separated string.
protected  void setUp(RenderContext renderContext)
          Setup.
 java.lang.String unRender(java.lang.String string, RenderContext renderContext, WikiFilter filter)
           
 
Methods inherited from class com.jivesoftware.forum.renderer.filter.regex.RegexTokenFilter
filter
 
Methods inherited from class com.jivesoftware.forum.renderer.filter.regex.RegexFilter
addRegex, addRegex, addRegex, addRegex, clearRegex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINK_MATCH

public static final java.lang.String LINK_MATCH
See Also:
Constant Field Values

MACRO_LINK_MATCH

public static final java.lang.String MACRO_LINK_MATCH
See Also:
Constant Field Values

LINK_ESCAPE_MATCH_1

public static final java.lang.String LINK_ESCAPE_MATCH_1
See Also:
Constant Field Values

LINK_ESCAPE_MATCH_2

public static final java.lang.String LINK_ESCAPE_MATCH_2
See Also:
Constant Field Values

LINK_ESCAPE_REPLACE_1

public static final java.lang.String LINK_ESCAPE_REPLACE_1
See Also:
Constant Field Values

LINK_ESCAPE_REPLACE_2

public static final java.lang.String LINK_ESCAPE_REPLACE_2
See Also:
Constant Field Values
Constructor Detail

WikiLinkRenderer

public WikiLinkRenderer()
Method Detail

render

public java.lang.String render(java.lang.String string,
                               RenderContext renderContext,
                               WikiFilter filter)
Specified by:
render in interface WikiRenderer

unRender

public java.lang.String unRender(java.lang.String string,
                                 RenderContext renderContext,
                                 WikiFilter filter)
Specified by:
unRender in interface WikiRenderer

setUp

protected void setUp(RenderContext renderContext)
Description copied from class: RegexTokenFilter
Setup.

Specified by:
setUp in class RegexTokenFilter
Parameters:
renderContext - the rendercontext

handleMatch

public void handleMatch(java.lang.StringBuffer buffer,
                        JdkMatchResult result,
                        RenderContext renderContext)
Description copied from class: RegexTokenFilter
Method is called for every occurnce of a regular expression. Subclasses have to implement this method.

Specified by:
handleMatch in class RegexTokenFilter
Parameters:
buffer - Buffer to write replacement string to
result - Hit with the found regular expression
renderContext - FilterContext for filters

retrieveLinks

public java.util.List retrieveLinks(java.lang.String string,
                                    RenderContext renderContext)

isATagFilter

protected boolean isATagFilter(java.lang.String string,
                               RenderContext renderContext)

getSchemes

public java.lang.String getSchemes()
Returns the current supported uri schemes as a comma separated string.

Returns:
the current supported uri schemes as a comma separated string.

setSchemes

public void setSchemes(java.lang.String schemes)
Sets the current supported uri schemes as a comma separated string.

Parameters:
schemes - a comma separated string of uri schemes.

isForceIDLinks

public boolean isForceIDLinks()
Returns true if all links are to be outputted as ID's. Default is false.

Returns:
true if all links are to be outputted as ID's

setForceIDLinks

public void setForceIDLinks(boolean forceIDLinks)
Set to true to force all links to be outputted as ID's

Parameters:
forceIDLinks - true to force all links to be outputted as ID's

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.