com.xpn.xwiki.render.filter
Class XWikiLinkFilter

java.lang.Object
  extended by org.radeox.filter.FilterSupport
      extended by org.radeox.filter.regex.RegexFilter
          extended by org.radeox.filter.regex.RegexTokenFilter
              extended by org.radeox.filter.regex.LocaleRegexTokenFilter
                  extended by com.xpn.xwiki.render.filter.XWikiLinkFilter
All Implemented Interfaces:
org.radeox.filter.Filter

public class XWikiLinkFilter
extends org.radeox.filter.regex.LocaleRegexTokenFilter

XWikiLinkFilter finds [text] in its input and transforms this to ... if the wiki page exists. If not it adds a [create text] to the output.


Field Summary
 
Fields inherited from class org.radeox.filter.regex.LocaleRegexTokenFilter
inputMessages, outputMessages
 
Fields inherited from class org.radeox.filter.regex.RegexFilter
MULTILINE, pattern, SINGLELINE, substitute
 
Fields inherited from class org.radeox.filter.FilterSupport
initialContext
 
Constructor Summary
XWikiLinkFilter()
           
 
Method Summary
static String convertWikiWords(String name)
           
protected  String getLocaleKey()
          The regular expression for detecting WikiLinks.
protected  String getWikiView(String name)
          Returns the view of the wiki name that is shown to the user.
 void handleMatch(StringBuffer buffer, org.radeox.regex.MatchResult result, org.radeox.filter.context.FilterContext context)
           
protected  void setUp(org.radeox.filter.context.FilterContext context)
           
 
Methods inherited from class org.radeox.filter.regex.LocaleRegexTokenFilter
getInputBundle, getOutputBundle, isSingleLine, setInitialContext
 
Methods inherited from class org.radeox.filter.regex.RegexTokenFilter
filter
 
Methods inherited from class org.radeox.filter.regex.RegexFilter
addRegex, addRegex, clearRegex
 
Methods inherited from class org.radeox.filter.FilterSupport
before, getDescription, replaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XWikiLinkFilter

public XWikiLinkFilter()
Method Detail

getLocaleKey

protected String getLocaleKey()
The regular expression for detecting WikiLinks. Overwrite in subclass to support other link styles like OldAndUglyWikiLinking :-) /[A-Z][a-z]+([A-Z][a-z]+)+/ wikiPattern = "\\[(.*?)\\]";

Specified by:
getLocaleKey in class org.radeox.filter.regex.LocaleRegexTokenFilter

setUp

protected void setUp(org.radeox.filter.context.FilterContext context)
Overrides:
setUp in class org.radeox.filter.regex.RegexTokenFilter

handleMatch

public void handleMatch(StringBuffer buffer,
                        org.radeox.regex.MatchResult result,
                        org.radeox.filter.context.FilterContext context)
Specified by:
handleMatch in class org.radeox.filter.regex.RegexTokenFilter

getWikiView

protected String getWikiView(String name)
Returns the view of the wiki name that is shown to the user. Overwrite to support other views for example transform "WikiLinking" to "Wiki Linking". Does nothing by default.

Returns:
view The view of the wiki name

convertWikiWords

public static String convertWikiWords(String name)


Copyright © 2004–2014 XWiki. All rights reserved.