Package org.apache.wiki.filters

## Interface FilterManager

All Superinterfaces:
  `ModuleManager`

All Known Implementing Classes:
  `DefaultFilterManager`

    public interface FilterManager
    extends ModuleManager

### Field Summary

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

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

`PLUGIN_RESOURCE_LOCATION`

### Method Summary

All Methods Instance Methods Abstract Methods
`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, java.lang.String pageData)` Does the page filtering after the page has been saved.
`java.lang.String` `doPostTranslateFiltering​(Context context, java.lang.String htmlData)` Does the filtering after HTML translation.
`java.lang.String` `doPreSaveFiltering​(Context context, java.lang.String pageData)` Does the filtering before a save to the page repository.
`java.lang.String` `doPreTranslateFiltering​(Context context, java.lang.String pageData)` Does the filtering before a translation.
`java.util.List<PageFilter>` `getFilterList()` Returns the list of filters currently installed.

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

`checkCompatibility, getModuleInfo, modules`

### Field Detail

#### PROP_FILTERXML

    static final java.lang.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 java.lang.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 Detail

#### addPageFilter

    void addPageFilter​(PageFilter f,
                       int priority)
                throws java.lang.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:
  `java.lang.IllegalArgumentException` - If the PageFilter is null or invalid.
Since:
  2.1.44.

#### doPreTranslateFiltering

    java.lang.String doPreTranslateFiltering​(Context context,
                                             java.lang.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

    java.lang.String doPostTranslateFiltering​(Context context,
                                              java.lang.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

    java.lang.String doPreSaveFiltering​(Context context,
                                        java.lang.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,
                             java.lang.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

    java.util.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.