org.springframework.extensions.surf.render
Class AbstractRenderer

java.lang.Object
  extended by org.springframework.extensions.surf.render.AbstractRenderer
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener, Renderer
Direct Known Subclasses:
ChromeRenderer, ComponentRenderer, PageRenderer, RegionRenderer, TemplateInstanceRenderer

public abstract class AbstractRenderer
extends Object
implements Renderer, org.springframework.context.ApplicationListener, org.springframework.context.ApplicationContextAware

An abstract implementation of the Renderer interface that can be extended by application developers for quick implementation.

Author:
muzquiano

Field Summary
protected  org.springframework.context.ApplicationContext applicationContext
           
protected static org.apache.commons.logging.Log logger
           
protected  Processor processor
           
 
Constructor Summary
AbstractRenderer()
           
 
Method Summary
 void all(RenderContext context)
          Executes the renderer in the "all" mode
abstract  void body(RenderContext context)
          Executes the renderer in the "body" mode
 void footer(RenderContext context)
          Executes the renderer in the "footer" mode
 org.springframework.context.ApplicationContext getApplicationContext()
          Gets the application context.
 Processor getProcessor()
           
 RenderService getRenderService()
          Gets the render service.
 WebFrameworkServiceRegistry getServiceRegistry()
          Gets the service registry.
 void header(RenderContext context)
          Executes the renderer in the "head" mode
 void init()
          Called upon initialization of the renderer
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
protected  void print(javax.servlet.http.HttpServletResponse response, String str)
          Commits the given string to the response output stream
protected static void print(RenderContext context, String str)
          Commits the given string to the response output stream
 void render(RenderContext context, RenderFocus focus)
          Executes the renderer in the given focus
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setProcessor(Processor processor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger

applicationContext

protected org.springframework.context.ApplicationContext applicationContext

processor

protected Processor processor
Constructor Detail

AbstractRenderer

public AbstractRenderer()
Method Detail

setProcessor

public void setProcessor(Processor processor)

getProcessor

public Processor getProcessor()

onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()
Gets the application context.

Returns:
the application context

getServiceRegistry

public WebFrameworkServiceRegistry getServiceRegistry()
Gets the service registry.

Returns:
the service registry

getRenderService

public RenderService getRenderService()
Gets the render service.

Returns:
the render service

init

public void init()
Description copied from interface: Renderer
Called upon initialization of the renderer

Specified by:
init in interface Renderer

render

public void render(RenderContext context,
                   RenderFocus focus)
            throws RendererExecutionException
Description copied from interface: Renderer
Executes the renderer in the given focus

Specified by:
render in interface Renderer
Throws:
RendererExecutionException

all

public void all(RenderContext context)
         throws RendererExecutionException
Description copied from interface: Renderer
Executes the renderer in the "all" mode

Specified by:
all in interface Renderer
Throws:
RendererExecutionException

header

public void header(RenderContext context)
            throws RendererExecutionException
Description copied from interface: Renderer
Executes the renderer in the "head" mode

Specified by:
header in interface Renderer
Throws:
RendererExecutionException

body

public abstract void body(RenderContext context)
                   throws RendererExecutionException
Description copied from interface: Renderer
Executes the renderer in the "body" mode

Specified by:
body in interface Renderer
Throws:
RendererExecutionException

footer

public void footer(RenderContext context)
            throws RendererExecutionException
Description copied from interface: Renderer
Executes the renderer in the "footer" mode

Specified by:
footer in interface Renderer
Throws:
RendererExecutionException

print

protected void print(javax.servlet.http.HttpServletResponse response,
                     String str)
              throws RendererExecutionException
Commits the given string to the response output stream

Parameters:
response - the response
str - the string
Throws:
RendererExecutionException

print

protected static void print(RenderContext context,
                            String str)
                     throws RendererExecutionException
Commits the given string to the response output stream

Parameters:
context - the render context
str - the string
Throws:
RendererExecutionException


Copyright © 2009 SpringSource, Inc. All Rights Reserved.