cage.writer
Class WriterFactory

java.lang.Object
  extended by cage.writer.WriterFactory

public class WriterFactory
extends java.lang.Object

Utility class for the creation of CaGeWriter objects.


Method Summary
static CaGeWriter createCaGeWriter(java.lang.String format)
          Returns a CaGeWriter based on the given format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createCaGeWriter

public static CaGeWriter createCaGeWriter(java.lang.String format)
Returns a CaGeWriter based on the given format. To determine the writer this methods goes through the following steps:
  1. First it is checked if there is cached value for the format.
  2. If CaGe.nativesAvailable is true, then it tries to find a class named Native + format + Writer in this package.
  3. If this fails, it looks for a class named format + Writer in this package.
  4. If it still didn't find a writer, it interprets the format as a full class name (including package) and tries to load it.
If all these attempts fail, this method gives up and returns null. Otherwise it caches the class and returns a new instance of the writer.

Parameters:
format - A String describing the format for which you want a writer, or the full name of a writer.
Returns:
A new instance of the writer corresponding to the given format or null if no writer class could be found for that format.