Package org.apache.wiki.filters

# Interface FilterManager

All Superinterfaces:
  `ModuleManager`

All Known Implementing Classes:
  `DefaultFilterManager`

public interface FilterManager extends ModuleManager

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_XMLFILE`
Default location for the filter XML property file.
`static final String`
`PROP_FILTERXML`
Property name for setting the filter XML property file.
`static final int`
`SYSTEM_FILTER_PRIORITY`
JSPWiki system filters are all below this value.
`static final int`
`USER_FILTER_PRIORITY`
The standard user level filtering.

### Fields inherited from interface org.apache.wiki.modules.ModuleManager

`PLUGIN_RESOURCE_LOCATION`

## Method Summary

Modifier and Type
Method
Description
`void`
`addPageFilter(PageFilter f, int priority)`
Adds a page filter to the queue.
`void`
`destroy()`
Notifies PageFilters to clean up their resources.
`void`
`doPostSaveFiltering(Context context, String pageData)`
Does the page filtering after the page has been saved.
`String`
`doPostTranslateFiltering(Context context, String htmlData)`
Does the filtering after HTML translation.
`String`
`doPreSaveFiltering(Context context, String pageData)`
Does the filtering before a save to the page repository.
`String`
`doPreTranslateFiltering(Context context, String pageData)`
Does the filtering before a translation.
`List<PageFilter>`
`getFilterList()`
Returns the list of filters currently installed.

### Methods inherited from interface org.apache.wiki.modules.ModuleManager

`checkCompatibility, getModuleInfo, modules`

## Field Details

### PROP_FILTERXML

static final String PROP_FILTERXML
Property name for setting the filter XML property file. Value is `"jspwiki.filterConfig"`.

See Also:
  - Constant Field Values

### DEFAULT_XMLFILE

static final String DEFAULT_XMLFILE
Default location for the filter XML property file. Value is `"/WEB-INF/filters.xml"`.

See Also:
  - Constant Field Values

### SYSTEM_FILTER_PRIORITY

static final int SYSTEM_FILTER_PRIORITY
JSPWiki system filters are all below this value.

See Also:
  - Constant Field Values

### USER_FILTER_PRIORITY

static final int USER_FILTER_PRIORITY
The standard user level filtering.

See Also:
  - Constant Field Values

## Method Details

### addPageFilter

void addPageFilter(PageFilter f, int priority) throws IllegalArgumentException
Adds a page filter to the queue. The priority defines in which order the page filters are run, the highest priority filters go in the queue first.

In case two filters have the same priority, their execution order is the insertion order.

Parameters:
  `f` - PageFilter to add
  `priority` - The priority in which position to add it in.
Throws:
  `IllegalArgumentException` - If the PageFilter is null or invalid.
Since:
  2.1.44.

### doPreTranslateFiltering

String doPreTranslateFiltering(Context context, String pageData) throws FilterException
Does the filtering before a translation.

Parameters:
  `context` - The WikiContext
  `pageData` - WikiMarkup data to be passed through the preTranslate chain.
Returns:
  The modified WikiMarkup
Throws:
  `FilterException` - If any of the filters throws a FilterException
See Also:
  - `PageFilter.preTranslate(Context, String)`

### doPostTranslateFiltering

String doPostTranslateFiltering(Context context, String htmlData) throws FilterException
Does the filtering after HTML translation.

Parameters:
  `context` - The WikiContext
  `htmlData` - HTML data to be passed through the postTranslate
Returns:
  The modified HTML
Throws:
  `FilterException` - If any of the filters throws a FilterException
See Also:
  - `PageFilter.postTranslate(Context, String)`

### doPreSaveFiltering

String doPreSaveFiltering(Context context, String pageData) throws FilterException
Does the filtering before a save to the page repository.

Parameters:
  `context` - The WikiContext
  `pageData` - WikiMarkup data to be passed through the preSave chain.
Returns:
  The modified WikiMarkup
Throws:
  `FilterException` - If any of the filters throws a FilterException
See Also:
  - `PageFilter.preSave(Context, String)`

### doPostSaveFiltering

void doPostSaveFiltering(Context context, String pageData) throws FilterException
Does the page filtering after the page has been saved.

Parameters:
  `context` - The WikiContext
  `pageData` - WikiMarkup data to be passed through the postSave chain.
Throws:
  `FilterException` - If any of the filters throws a FilterException
See Also:
  - `PageFilter.postSave(Context, String)`

### getFilterList

List<PageFilter> getFilterList()
Returns the list of filters currently installed. Note that this is not a copy, but the actual list. So be careful with it.

Returns:
  A List of PageFilter objects

### destroy

void destroy()
Notifies PageFilters to clean up their resources.