org.apache.wiki.filters
Class ProfanityFilter

java.lang.Object
  extended by org.apache.wiki.api.filters.BasicPageFilter
      extended by org.apache.wiki.filters.ProfanityFilter
All Implemented Interfaces:
PageFilter

public class ProfanityFilter
extends BasicPageFilter

This class is an example of how to have a simple filter. It removes all nasty words located at profanity.properties file, inside org/apache/wiki/filters package. The search of profanities is case unsensitive.


Field Summary
 
Fields inherited from class org.apache.wiki.api.filters.BasicPageFilter
m_engine
 
Constructor Summary
ProfanityFilter()
           
 
Method Summary
 String preTranslate(WikiContext context, String content)
          This method is called whenever a page has been loaded from the provider, but not yet been sent through the markup-translation process.
 
Methods inherited from class org.apache.wiki.api.filters.BasicPageFilter
destroy, initialize, postSave, postTranslate, preSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfanityFilter

public ProfanityFilter()
Method Detail

preTranslate

public String preTranslate(WikiContext context,
                           String content)
This method is called whenever a page has been loaded from the provider, but not yet been sent through the markup-translation process. Note that you cannot do HTML translation here, because it will be escaped.

Specified by:
preTranslate in interface PageFilter
Overrides:
preTranslate in class BasicPageFilter
Parameters:
context - The current wikicontext.
content - WikiMarkup.
Returns:
The modified wikimarkup content.


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.