com.atlassian.plugin.web.renderer
Class StaticWebPanelRenderer

java.lang.Object
  extended by com.atlassian.plugin.web.renderer.StaticWebPanelRenderer
All Implemented Interfaces:
WebPanelRenderer

public class StaticWebPanelRenderer
extends Object
implements WebPanelRenderer

Static WebPanelRenderer, just returns the supplied text.


Field Summary
static StaticWebPanelRenderer RENDERER
           
static String RESOURCE_TYPE
           
 
Constructor Summary
StaticWebPanelRenderer()
           
 
Method Summary
 String getResourceType()
           
 void render(String templateName, Plugin plugin, Map<String,Object> context, Writer writer)
          Renders the template to the writer.
 String renderFragment(String fragment, Plugin plugin, Map<String,Object> context)
          Renders the fragment using the given context and adding I18nResolver and WebResourceManager.
 void renderFragment(Writer writer, String fragment, Plugin plugin, Map<String,Object> context)
          Renders the fragment using the given context and adding I18nResolver and WebResourceManager, writing the output to the provided writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RENDERER

public static final StaticWebPanelRenderer RENDERER

RESOURCE_TYPE

public static final String RESOURCE_TYPE
See Also:
Constant Field Values
Constructor Detail

StaticWebPanelRenderer

public StaticWebPanelRenderer()
Method Detail

getResourceType

public String getResourceType()
Specified by:
getResourceType in interface WebPanelRenderer
Returns:
the name of the resource type supported by this renderer. <resource> elements defined in plugin descriptors to be rendered by this renderer should specify this String as their type attribute.

render

public void render(String templateName,
                   Plugin plugin,
                   Map<String,Object> context,
                   Writer writer)
            throws RendererException,
                   IOException
Description copied from interface: WebPanelRenderer
Renders the template to the writer.

Specified by:
render in interface WebPanelRenderer
Parameters:
templateName - file name of the template to render
plugin - the context plugin. Used, for example, to resolve templates and other resources from the classpath via Plugin.getClassLoader()
context - Map of objects to make available in the template rendering process
writer - where to write the rendered template
Throws:
RendererException - thrown if there is an internal exception when rendering the template
IOException - thrown if there is a problem reading the template file or writing to the writer

renderFragment

public String renderFragment(String fragment,
                             Plugin plugin,
                             Map<String,Object> context)
                      throws RendererException
Description copied from interface: WebPanelRenderer
Renders the fragment using the given context and adding I18nResolver and WebResourceManager.

Specified by:
renderFragment in interface WebPanelRenderer
Parameters:
fragment - template fragment to render
plugin - the context plugin. Used, for example, to resolve templates and other resources from the classpath via Plugin.getClassLoader()
context - Map of objects to make available in the template rendering process
Returns:
rendered template
Throws:
RendererException - thrown if there is an internal exception when rendering the template

renderFragment

public void renderFragment(Writer writer,
                           String fragment,
                           Plugin plugin,
                           Map<String,Object> context)
                    throws RendererException,
                           IOException
Description copied from interface: WebPanelRenderer
Renders the fragment using the given context and adding I18nResolver and WebResourceManager, writing the output to the provided writer.

Specified by:
renderFragment in interface WebPanelRenderer
Parameters:
writer - the writer to append the output to
fragment - template fragment to render
plugin - the context plugin. Used, for example, to resolve templates and other resources from the classpath via Plugin.getClassLoader()
context - Map of objects to make available in the template rendering process
Throws:
RendererException - thrown if there is an internal exception when rendering the template
IOException - if there is some problem writing to the supplied writer


Copyright © 2013 Atlassian. All Rights Reserved.