Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.renderer
Interface RenderContext


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.getLongRowMapper(); 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
 Object getContextParameter(String key)
          Returns the context parameter associated with the specified key, or null if no association exists.
 Map getContextParameters()
          Returns a map of all the context parameters.
 List<String> getFilterTags()
          Returns a list of tags for all the currently configured render filters which implement the TagFilter interface.
 JiveContext getJiveContext()
          Returns the jive context under which the filter is executing.
 RenderPipe getRenderPipe()
          Returns the render pipe that will be used for rendering.
 RenderStrategy getRenderStrategy()
          Returns the render strategy that will be used for rendering.
 JiveObject getSourceObject()
          Returns the source object for which we're filtering a string from.
 boolean isCachingDisabled()
          Returns true is caching of generated output is disabled, false otherwise.
 void setCachingDisabled(boolean disabled)
          Sets whether caching of generated output is disabled or not.
 void setContextParameter(String key, 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

JiveObject 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.

getJiveContext

JiveContext getJiveContext()
Returns the jive context under which the filter is executing.

Returns:
the jive context under which the filter is executing.

getContextParameters

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

Returns:
a map of all the context parameters.

getContextParameter

Object getContextParameter(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(String key,
                         Object value)
Set a context parameter.

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

isCachingDisabled

boolean isCachingDisabled()
Returns true is caching of generated output is disabled, false otherwise. Default is false.

Returns:
true is caching of generated output is disabled, false otherwise.

setCachingDisabled

void setCachingDisabled(boolean disabled)
Sets whether caching of generated output is disabled or not. Default is false.

Parameters:
disabled - true if caching of generated output should be disabled, false otherwise.

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.

getFilterTags

List<String> 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.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.