info.aduna.gee.spectacle.gee
Class TemplateEntryRenderer

java.lang.Object
  extended by info.aduna.gee.spectacle.gee.TemplateEntryRenderer
All Implemented Interfaces:
EntryRenderer

public class TemplateEntryRenderer
extends Object
implements EntryRenderer

Class TemplateEntryRenderer provides a generic way to render Entities using a Template.


Constructor Summary
TemplateEntryRenderer()
          For serialization only.
TemplateEntryRenderer(String templateSource, String templateID)
          Construct a new TemplateEntryRenderer.
 
Method Summary
 void render(Entity entity, Channel channel)
          Perform the actual rendering of an entity in a channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateEntryRenderer

public TemplateEntryRenderer()
For serialization only.


TemplateEntryRenderer

public TemplateEntryRenderer(String templateSource,
                             String templateID)
Construct a new TemplateEntryRenderer.

Parameters:
templateSource - The channel containing the Template to use.
templateID - The ID of the Template to use.
Method Detail

render

public void render(Entity entity,
                   Channel channel)
            throws ChannelException
Perform the actual rendering of an entity in a channel. All key/value pairs are considered to be used by the Template. Since neither key nor value is required to be a String, for both toString() is applied. Furthermore, the key is "uppercased" by "toUpperCase()". So take care that the Template uses upper case stubs for all values provided by Entities.

Specified by:
render in interface EntryRenderer
Parameters:
entity - The Entity to render.
channel - The channel to render the Entiry in.
Throws:
ChannelException - if something goes wrong adding the rendered entity (i.e. the Entry) to the Channel.


Copyright © 1997-2008 Aduna. All Rights Reserved.