public abstract class AbstractRenderer extends Object implements Renderer
An abstract implementation of the Renderer interface that can be extended by application developers for quick implementation.
| Constructor and Description |
|---|
AbstractRenderer() |
| Modifier and Type | Method and Description |
|---|---|
void |
all(RequestContext context,
ModelObject object)
Renders both the header and body focus by calling the
header and body methods
in succession. |
abstract void |
body(RequestContext context,
ModelObject object)
This method must be implemented by concrete subclasses to render the body focus for artifact
being handled by the renderer.
|
RenderService |
getRenderService()
Gets the render service.
|
void |
header(RequestContext context,
ModelObject object)
This method should be overridden by concrete subclasses to render the header focus for artifact
being handled by the renderer.
|
protected void |
print(javax.servlet.http.HttpServletResponse response,
String str)
Commits the given string to the response output stream
|
protected static void |
print(RequestContext context,
String str)
Commits the given string to the response output stream
|
void |
render(RequestContext context,
ModelObject object,
RenderFocus focus)
This method directs rendering requests to the appropriate method for the
RenderFocus provided. |
void |
setRenderService(RenderService renderService) |
public void setRenderService(RenderService renderService)
public RenderService getRenderService()
public void render(RequestContext context, ModelObject object, RenderFocus focus) throws RendererExecutionException
This method directs rendering requests to the appropriate method for the RenderFocus provided. It
should only be overridden in exceptional circumstances as actual rendering should be carried out in the body
and header methods.
render in interface Renderercontext - The current RequestContext that contains all the information required to perform rendering.object - The current object to be rendered.focus - The focus to be rendered.RendererExecutionException - If the concrete rendering subclass methods fail to render the request.public void all(RequestContext context, ModelObject object) throws RendererExecutionException
Renders both the header and body focus by calling the header and body methods
in succession. This method is invoked from the render method when a RenderFocus
of "ALL" is provided.
all in interface Renderercontext - The current RequestContext that contains all the information required to perform rendering.object - The current object to be rendered.RendererExecutionException - if thrown from the header or body methods.public void header(RequestContext context, ModelObject object) throws RendererExecutionException
This method should be overridden by concrete subclasses to render the header focus for artifact being handled by the renderer.
header in interface Renderercontext - The current RequestContext that contains all the information required to perform rendering.object - The current object to be rendered.RendererExecutionException - If rendering cannot be completed without error.public abstract void body(RequestContext context, ModelObject object) throws RendererExecutionException
This method must be implemented by concrete subclasses to render the body focus for artifact being handled by the renderer.
body in interface Renderercontext - The current RequestContext that contains all the information required to perform rendering.object - The current object to be rendered.RendererExecutionException - If rendering cannot be completed without error.protected void print(javax.servlet.http.HttpServletResponse response,
String str)
throws RendererExecutionException
response - the responsestr - the stringRendererExecutionExceptionprotected static void print(RequestContext context, String str) throws RendererExecutionException
context - the render contextstr - the stringRendererExecutionExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.