Jive API ( Core Javadocs

Interface RenderFilter

All Superinterfaces:
All Known Implementing Classes:
AbstractRenderFilter, BaseFilter

public interface RenderFilter
extends com.jivesoftware.community.renderer.RenderPlugin

A filter is an object that performs filtering on Strings. For example, a filter might look for newline characters in a string (\n, \r\n) and replace them with <br> or <p> tags.

It is recommended that each filter provide through the BeanInfo interface the following:

These values can then be internationalized as necessary using ResourceBundles. For example, say you create a filter com.foo.SampleFilter. You should also create a class named com.foo.SampleFilterBeanInfo that extends the JiveBeanInfo class. Then, create a resource bundle named bean_SampleFilter.properties and other property files for various locales as desired.

Filters have 0 or more properties that can be configured by an administrator. Each property may control any aspect of how the filter works -- for example, a property named "color" could control which color to format text in. All properties are configurable through the standard JavaBeans conventions. You should specify exactly which properties can be controlled by an administrator by using the BeanInfo interface and JiveBeanInfo class described above.

If end user documentation is pertinent to the filter (i.e. end users may need to know a tag syntax for the filter to function) documentation should be returned from the getUserDocumentation(String) method. The output of this method is expected to follow the guidelines outlined in the documentation distributed with the product.

Instantiating classes of this interface are required to have a zero argument constructor.

See Also:

Method Summary
 void execute(org.w3c.dom.Document document, RenderContext renderContext)
          Process the xml document that is passed to this method.
 int getOrder()
          Return the order in which to place the filter in the render pipeline.
 java.lang.String[] getUserDocumentation(java.lang.String language)
          Returns a string array of [section,title, body] of xml formatted documentation that is targetted for end user usage.
 boolean isDisplayable()
Methods inherited from interface com.jivesoftware.community.renderer.RenderPlugin
getName, getParameters, isEnabled, setEnabled, setParameters

Method Detail


void execute(org.w3c.dom.Document document,
             RenderContext renderContext)
Process the xml document that is passed to this method. Render filters modify the document in place buy adding, modify and/or removing elements from the document.

document - the element to filter
renderContext - the context the filter is being executed within


java.lang.String[] getUserDocumentation(java.lang.String language)
Returns a string array of [section,title, body] of xml formatted documentation that is targetted for end user usage. Documentation on how this output should be formatted can be found in the documentation that is shipped with this product.

language - the language as an ISO-639 language code to return the documentation in.
a string array of [section, title, body] or null if end user documentation is not relevant to the filter.


boolean isDisplayable()


int getOrder()
Return the order in which to place the filter in the render pipeline. A filter with order value of 0 will be applied before a filter of order 1.

Specified by:
getOrder in interface com.jivesoftware.community.renderer.RenderPlugin
order in which to apply the filter

Jive Product Page

Copyright © 1999-2007 Jive Software.