org.mmbase.framework
Class AbstractRenderer

java.lang.Object
  extended by org.mmbase.framework.AbstractRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
ChainedRenderer, ConnectionRenderer, DeniedRenderer, ErrorRenderer, IFrameRenderer, JspRenderer, ResourceRenderer, StringRenderer, WrappedRenderer

public abstract class AbstractRenderer
extends Object
implements Renderer

Abstract renderer implementation which implements getType and getBlock.

Since:
MMBase-1.9
Version:
$Id: AbstractRenderer.java 41989 2010-04-20 16:45:39Z michiel $
Author:
Michiel Meeuwissen

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mmbase.framework.Renderer
Renderer.Type
 
Field Summary
protected  Renderer.Type type
           
 
Constructor Summary
AbstractRenderer(Renderer.Type t, Block p)
           
 
Method Summary
protected  void decorateIntro(RenderHints hints, Writer w, String extraClass)
          This utility method, which of course must be used in conjuction with decorateOutro(org.mmbase.framework.RenderHints, java.io.Writer) can be used in concretizations of this class, for easy production of the div which is requested by the contract of a (Renderer.Type.BODY) renderer for text/html.
protected  void decorateOutro(RenderHints hints, Writer w)
           
 Block getBlock()
          Every renderer renders for a certain block.
 Parameter[] getParameters()
          A renderer may need certain parameters.
 Renderer.Type getType()
          Describes what kind of renderer this is
 URI getUri()
          An URI which may identify the implementation of this Renderer.
 URI getUri(Parameters blockParameters, RenderHints hints)
          Ann URL which may identify a specific rendition
abstract  void render(Parameters blockParameters, Writer w, RenderHints hints)
          Renders to a writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected final Renderer.Type type
Constructor Detail

AbstractRenderer

public AbstractRenderer(Renderer.Type t,
                        Block p)
Method Detail

getType

public Renderer.Type getType()
Description copied from interface: Renderer
Describes what kind of renderer this is

Specified by:
getType in interface Renderer

getBlock

public Block getBlock()
Description copied from interface: Renderer
Every renderer renders for a certain block.

Specified by:
getBlock in interface Renderer

getUri

public URI getUri()
Description copied from interface: Renderer
An URI which may identify the implementation of this Renderer.

Specified by:
getUri in interface Renderer

getUri

public URI getUri(Parameters blockParameters,
                  RenderHints hints)
Description copied from interface: Renderer
Ann URL which may identify a specific rendition

Specified by:
getUri in interface Renderer

decorateIntro

protected void decorateIntro(RenderHints hints,
                             Writer w,
                             String extraClass)
                      throws IOException
This utility method, which of course must be used in conjuction with decorateOutro(org.mmbase.framework.RenderHints, java.io.Writer) can be used in concretizations of this class, for easy production of the div which is requested by the contract of a (Renderer.Type.BODY) renderer for text/html.

Throws:
IOException

decorateOutro

protected void decorateOutro(RenderHints hints,
                             Writer w)
                      throws IOException
Throws:
IOException

getParameters

public Parameter[] getParameters()
Description copied from interface: Renderer
A renderer may need certain parameters. These are added to the block-parameters. This method is called on instantation of the renderer.

Specified by:
getParameters in interface Renderer

render

public abstract void render(Parameters blockParameters,
                            Writer w,
                            RenderHints hints)
                     throws FrameworkException
Description copied from interface: Renderer
Renders to a writer. In case of e.g. a JSPView, the parameters must also contain the Http Servlet response and request, besided specific parameters for this component.

Specified by:
render in interface Renderer
Throws:
FrameworkException


MMBase 2.0-SNAPSHOT - null