Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.renderer
Class AbstractRenderFilter

java.lang.Object
  extended by com.jivesoftware.community.renderer.AbstractRenderFilter
All Implemented Interfaces:
RenderFilter, com.jivesoftware.community.renderer.RenderPlugin
Direct Known Subclasses:
BaseFilter

public abstract class AbstractRenderFilter
extends Object
implements RenderFilter

An abstract implementation of the RenderFilter interface this class provides subclasses with built in support for documentation and splits apart the execute method into seperate methods depending on the render target specified in the render context.


Constructor Summary
AbstractRenderFilter()
           
 
Method Summary
protected abstract  String[] getDefaultHelp()
          Returns a String[section,title,body] for the default help for the filter.
protected abstract  Map<String,String[]> getDocumentationMap()
          Returns a documentation Map keyed by languageCode -> String[section,title,body].
abstract  String getName()
           
 int getOrder()
          Return the order in which to place the filter in the render pipeline.
 Map<String,String> getParameters()
           
 String[] getUserDocumentation(String language)
          Returns a string array of [section,title, body] of xml formatted documentation that is targetted for end user usage.
 boolean isDisplayable()
          The default behavior is to display the filter/macro.
 boolean isEnabled()
           
protected abstract  boolean isEnabledByDefault()
          Returns true if the filter should be enabled by default, false otherwise.
protected  boolean isModifiable(Node node)
           
 void setEnabled(boolean enabled)
           
 void setParameters(Map<String,String> parameters)
           
 boolean shouldProcess(Element e, RenderContext context)
          Checks to see if the element should be processed by this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jivesoftware.community.renderer.RenderFilter
execute
 

Constructor Detail

AbstractRenderFilter

public AbstractRenderFilter()
Method Detail

getName

public abstract String getName()
Specified by:
getName in interface com.jivesoftware.community.renderer.RenderPlugin

getParameters

public Map<String,String> getParameters()
Specified by:
getParameters in interface com.jivesoftware.community.renderer.RenderPlugin

setParameters

public void setParameters(Map<String,String> parameters)
Specified by:
setParameters in interface com.jivesoftware.community.renderer.RenderPlugin

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface com.jivesoftware.community.renderer.RenderPlugin

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface com.jivesoftware.community.renderer.RenderPlugin

isDisplayable

public boolean isDisplayable()
The default behavior is to display the filter/macro. This can be overwritten by using a system property (like renderFilter.SomeFilter.isDisplayable = false)

Specified by:
isDisplayable in interface RenderFilter
Returns:

isEnabledByDefault

protected abstract boolean isEnabledByDefault()
Returns true if the filter should be enabled by default, false otherwise.

Returns:
true if the filter should be enabled by default, false otherwise.

getUserDocumentation

public String[] getUserDocumentation(String language)
Description copied from interface: RenderFilter
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.

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

getDocumentationMap

protected abstract Map<String,String[]> getDocumentationMap()
Returns a documentation Map keyed by languageCode -> String[section,title,body].

Returns:
a documentation Map keyed by languageCode -> String[section,title,body]

getDefaultHelp

protected abstract String[] getDefaultHelp()
Returns a String[section,title,body] for the default help for the filter.

Returns:
a String[section,title,body] for the default help for the filter

getOrder

public int getOrder()
Description copied from interface: RenderFilter
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 RenderFilter
Specified by:
getOrder in interface com.jivesoftware.community.renderer.RenderPlugin
Returns:
order in which to apply the filter

shouldProcess

public boolean shouldProcess(Element e,
                             RenderContext context)
Checks to see if the element should be processed by this filter.

Parameters:
e - element
context - RenderContext
Returns:
true if the element should be processed by the filter

isModifiable

protected boolean isModifiable(Node node)

Clearspace Project Page

Copyright © 1999-2007 Jive Software.