com.atlassian.jira.issue.managers
Class DefaultRendererManager

java.lang.Object
  extended by com.atlassian.jira.issue.managers.DefaultRendererManager
All Implemented Interfaces:
RendererManager

public class DefaultRendererManager
extends Object
implements RendererManager

The default implementation of a RendererManager.


Constructor Summary
DefaultRendererManager(com.atlassian.plugin.PluginManager pluginManager)
           
 
Method Summary
 List getAllActiveRenderers()
          Gets all the renderers in the system that have a RenderConfiguration in which the renderer is set as active.
 String getRenderedContent(FieldLayoutItem fieldConfig, Issue issue)
          A convienience method that is the equivilant of calling the getRendererForField method and then invoking the render method on the returned renderer, using the value of the field that is associated with the issue.
 String getRenderedContent(FieldRenderContext fieldRenderContext)
           
 String getRenderedContent(String rendererType, String value, IssueRenderContext renderContext)
          A convienience method that is the equivilant of calling the getRendererForField method and then invoking the render method on the returned renderer, using the value of the field that is associated with the issue.
 JiraRendererPlugin getRendererForField(FieldLayoutItem fieldConfig)
          This will returned the correct renderer for a provided field and a provided issue.
 JiraRendererPlugin getRendererForType(String rendererType)
          Will return a field renderer for the given renderer type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRendererManager

public DefaultRendererManager(com.atlassian.plugin.PluginManager pluginManager)
Method Detail

getAllActiveRenderers

public List getAllActiveRenderers()
Description copied from interface: RendererManager
Gets all the renderers in the system that have a RenderConfiguration in which the renderer is set as active.

Specified by:
getAllActiveRenderers in interface RendererManager
Returns:
a list containing Renderer objects whose RenderConfiguration in which the renderer is set as active.

getRendererForType

public JiraRendererPlugin getRendererForType(String rendererType)
Description copied from interface: RendererManager
Will return a field renderer for the given renderer type. If the renderer does not exist for the type then this will return null.

Specified by:
getRendererForType in interface RendererManager
Parameters:
rendererType - a string identifier that uniquely identifies a renderer in the system.
Returns:
an instance of a FieldRenderer for the requested type, null if no renderer exists for the type.

getRendererForField

public JiraRendererPlugin getRendererForField(FieldLayoutItem fieldConfig)
Description copied from interface: RendererManager
This will returned the correct renderer for a provided field and a provided issue. This method takes into account any system preferences for renderers and will return the correct system renderer.

Specified by:
getRendererForField in interface RendererManager
Parameters:
fieldConfig - is the configuration object for the given field.
Returns:
a field renderer that will be able to render the content of the specified field in the specified issue correctly.

getRenderedContent

public String getRenderedContent(FieldLayoutItem fieldConfig,
                                 Issue issue)
Description copied from interface: RendererManager
A convienience method that is the equivilant of calling the getRendererForField method and then invoking the render method on the returned renderer, using the value of the field that is associated with the issue. This will make sure that the passed context is initialized.

Specified by:
getRenderedContent in interface RendererManager
Parameters:
fieldConfig - identifies the configuration of the System or Custom field that is the object of the renderering.
issue - identifies the unique instance container of the field that will be rendered.
Returns:
a string that has been processed through the correct renderer, the string will be processed through the default renderer if there was an error resolving the specified renderers.

getRenderedContent

public String getRenderedContent(String rendererType,
                                 String value,
                                 IssueRenderContext renderContext)
Description copied from interface: RendererManager
A convienience method that is the equivilant of calling the getRendererForField method and then invoking the render method on the returned renderer, using the value of the field that is associated with the issue. This will make sure that the passed context is initialized.

Specified by:
getRenderedContent in interface RendererManager
Parameters:
rendererType - is the renderer to use, if not resolved will fall back to the system default.
value - is the value to render.
renderContext - is the context to use for rendering.
Returns:
a string that has been processed through the correct renderer, the string will be unprocessed if there was an error resolving renderers.

getRenderedContent

public String getRenderedContent(FieldRenderContext fieldRenderContext)
Specified by:
getRenderedContent in interface RendererManager


Copyright © 2002-2009 Atlassian. All Rights Reserved.