com.chaosserver.bilbo.task.generate
Class FormatterFactory

java.lang.Object
  |
  +--com.chaosserver.bilbo.task.generate.FormatterFactory

public class FormatterFactory
extends Object

Factory object used to create formatters.

Since:
Bilbo 2.0

Field Summary
protected  Map formatterMap
          Holds the map of formatter names to formatter class names.
protected static FormatterFactory self
          Self reference for singleton.
protected static String SYNC
          Synchronization object.
 
Constructor Summary
protected FormatterFactory()
          Default constructor.
 
Method Summary
 Formatter getFormatter(String formatterName)
          Gets an instance of a formatter object for the name given.
protected  Map getFormatterMap()
          Getter for the formatterMap
static FormatterFactory getInstance()
          Gets the instance of the FormatterFactory.
protected  void loadFormatterMap()
          Loads the formatter map from file.
protected  void setFormatterMap(Map formatterMap)
          Setter for the formatterMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

self

protected static FormatterFactory self
Self reference for singleton.


SYNC

protected static String SYNC
Synchronization object.


formatterMap

protected Map formatterMap
Holds the map of formatter names to formatter class names.

Constructor Detail

FormatterFactory

protected FormatterFactory()
Default constructor.

Method Detail

setFormatterMap

protected void setFormatterMap(Map formatterMap)
Setter for the formatterMap

Parameters:
formatterMap - the formatterMap

getFormatterMap

protected Map getFormatterMap()
Getter for the formatterMap

Returns:
the formatterMap

loadFormatterMap

protected void loadFormatterMap()
Loads the formatter map from file.


getInstance

public static FormatterFactory getInstance()
Gets the instance of the FormatterFactory.

Returns:
the FormatterFactory

getFormatter

public Formatter getFormatter(String formatterName)
                       throws NoSuchFormatterException,
                              FormatterCreationException
Gets an instance of a formatter object for the name given.

Parameters:
formatterName - the name of the formatter to get
Returns:
a formatter for the name given
Throws:
NoSuchFormatterException - if there is no formatter for this name
FormatterCreationException - if there is an error instantiating the formatter


Copyright © 20020228