Version: 1.1.1

org.biomoby.service.dashboard.renderers
Class RendererRegistry

java.lang.Object
  extended by org.biomoby.service.dashboard.renderers.RendererRegistry

public class RendererRegistry
extends Object

A registry that maintains a list of all renderer service providers.

The RendererRegistry should be accessed through the instance obtained by calling RendererRegistry.instance(). This instance is initialised with the SPI implementations available through the current class path.

Version:
$Id: RendererRegistry.java,v 1.3 2006/02/20 05:51:11 senger Exp $
Author:
Martin Senger (based on work by Matthew Pocock for Taverna)

Method Summary
 void addRenderer(Renderer renderer)
          Add a renderer to this registry.
 Renderer get(int index)
          Get index-th renderer.
 Renderer getRenderer(String criterion, Object value)
          Get a default renderer for given 'value' within given 'criterion'.
 List getRenderers(String criterion, Object value)
          Get all renderers for given 'value' within given 'criterion'.
static RendererRegistry instance()
           
 Iterator iterator()
          Return an iterator over all registered renderers.
 void loadInstances(ClassLoader classLoader)
          Load all Renderer implementations that are registered in the given ClassLoader.
 void removeRenderer(Renderer renderer)
          Remove a renderer from this registry.
 int size()
          How many renderers are available.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static RendererRegistry instance()

loadInstances

public void loadInstances(ClassLoader classLoader)
Load all Renderer implementations that are registered in the given ClassLoader.

Parameters:
classLoader - a ClassLoader which will be searched

getRenderer

public Renderer getRenderer(String criterion,
                            Object value)
Get a default renderer for given 'value' within given 'criterion'.

Parameters:
criterion - is a category of the value, e.g. "MIME-TYPE"
value - is a value from the category criterion, e.g. "text/xml"
Returns:
the first found renderer complying with given value/criterion, or null if none such renderer is available

getRenderers

public List getRenderers(String criterion,
                         Object value)
Get all renderers for given 'value' within given 'criterion'.

Parameters:
criterion - is a category of the value, e.g. "MIME-TYPE"
value - is a value from the category criterion, e.g. "text/xml"
Returns:
a (possibly empty) list of matching Renderer instances

addRenderer

public void addRenderer(Renderer renderer)
Add a renderer to this registry.


removeRenderer

public void removeRenderer(Renderer renderer)
Remove a renderer from this registry.


size

public int size()
How many renderers are available.


iterator

public Iterator iterator()
Return an iterator over all registered renderers.


get

public Renderer get(int index)
Get index-th renderer.


Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010