Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.renderer
Interface RenderContext

All Known Implementing Classes:
JiveRenderContext

public interface RenderContext

Encapsulates the context in which a piece of content is being rendered. An example usage of this class is outlined below:

RenderFilter[] filters = new RenderFilter[] { new StyleFilter(), new TableFilter() }; RenderPipe pipe = new RenderPipe(filters); RenderStrategy strategy = new RenderStrategy(RenderTarget.TARGET_HTML, RenderStrategy.RENDER_ALL); RenderContext context = new JiveRenderContext(...); context.setRenderPipe(pipe); context.setRenderStrategy(strategy); Renderer renderer = RendererFactory.getInstance(); String renderedText = renderer.render(text, context); This class also provides access to a RenderedTextStore which can be used to hold snippets of text to hide them from further processing.

See Also:
Renderer

Method Summary
 java.lang.Object getContextParameter(java.lang.String key)
          Returns the context parameter associated with the specified key, or null if no association exists.
 java.util.Map getContextParameters()
          Returns a map of all the context parameters.
 java.util.List getFilterTags()
          Returns a list of tags for all the currently configured render filters which implement the TagFilter interface.
 ForumFactory getForumFactory()
          Returns the forum factory under which the filter is executing.
 RenderedTextStore getRenderedTextStore()
          Returns the text store associated with the context.
 RenderPipe getRenderPipe()
          Returns the render pipe that will be used for rendering.
 RenderStrategy getRenderStrategy()
          Returns the render strategy that will be used for rendering.
 java.lang.Object getSourceObject()
          Returns the source object for which we're filtering a string from.
 void setContextParameter(java.lang.String key, java.lang.Object value)
          Set a context parameter.
 void setRenderPipe(RenderPipe pipe)
          Sets the render pipe that will be used for rendering.
 void setRenderStrategy(RenderStrategy renderStrategy)
          Sets the render strategy that will be used for rendering.
 

Method Detail

getSourceObject

java.lang.Object getSourceObject()
Returns the source object for which we're filtering a string from. This method allows a filter or macro to get access to the source object if required.

Returns:
the source object for which we're filtering a string from.

getForumFactory

ForumFactory getForumFactory()
Returns the forum factory under which the filter is executing.

Returns:
the forum factory under which the filter is executing.

getContextParameters

java.util.Map getContextParameters()
Returns a map of all the context parameters.

Returns:
a map of all the context parameters.

getContextParameter

java.lang.Object getContextParameter(java.lang.String key)
Returns the context parameter associated with the specified key, or null if no association exists.

Parameters:
key - the context parameter key
Returns:
the context parameter associated with the specified key

setContextParameter

void setContextParameter(java.lang.String key,
                         java.lang.Object value)
Set a context parameter.

Parameters:
key - the context parameter key
value - the context parameter value

getRenderStrategy

RenderStrategy getRenderStrategy()
Returns the render strategy that will be used for rendering.

Returns:
the render strategy that will be used for rendering.

setRenderStrategy

void setRenderStrategy(RenderStrategy renderStrategy)
Sets the render strategy that will be used for rendering.

Parameters:
renderStrategy - the render strategy that will be used for rendering.

getRenderPipe

RenderPipe getRenderPipe()
Returns the render pipe that will be used for rendering.

Returns:
the render pipe that will be used for rendering.

setRenderPipe

void setRenderPipe(RenderPipe pipe)
Sets the render pipe that will be used for rendering.

Parameters:
pipe - the render pipe that will be used for rendering.

getRenderedTextStore

RenderedTextStore getRenderedTextStore()
Returns the text store associated with the context.

Returns:
the text store associated with the context.

getFilterTags

java.util.List getFilterTags()
Returns a list of tags for all the currently configured render filters which implement the TagFilter interface. This method is provided since some filters need to know what other tags are being used by other filters.

Returns:
a list of tags for all the configured render filters implementing the TagFilter interface.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.