org.inria.ns.reflex.xml.serialize
Class SerializerFactory

java.lang.Object
  extended by org.inria.ns.reflex.xml.serialize.SerializerFactory
Direct Known Subclasses:
JPEGSerializerFactory, PCLSerializerFactory, PDFSerializerFactory, PNGSerializerFactory, PSSerializerFactory, TIFFSerializerFactory

public abstract class SerializerFactory
extends Object

A serializer factory supplies concrete implementations of serializers according to the target MIME type.

Concrete implementations are supplied by the discovery mechanism, so that they can be extended or overridden.

Default implementations of serializer factories available with RefleX are localized in the "META-INF/services/org.inria.ns.reflex.xml.serialize.SerializerFactory/" directory of the jar file. From this directory, the MIME type is the relative path that contains the class name of the default implementation for that MIME type.

For example, "META-INF/services/org.inria.ns.reflex.xml.serialize.SerializerFactory/image/jpeg" is a file that contains the name of the serializer "org.inria.ns.reflex.xml.provider.svg.JPEGSerializerFactory".

Author:
Philippe Poulard
See Also:
Discover

Constructor Summary
SerializerFactory()
           
 
Method Summary
static SerializerFactory getSerializerFactory(String mimeType)
          Get a specific serializer factory (FO to PDF, SVG to JPEG, etc), or null.
abstract  Serializer newSerializer()
          Return a new serializer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializerFactory

public SerializerFactory()
Method Detail

getSerializerFactory

public static SerializerFactory getSerializerFactory(String mimeType)
                                              throws InstantiationException,
                                                     IllegalAccessException,
                                                     ClassNotFoundException
Get a specific serializer factory (FO to PDF, SVG to JPEG, etc), or null.

Parameters:
mimeType - The MIME type of the expected output.
Returns:
The serializer factory, according to the MIME type, or null if not supported.
Throws:
ClassNotFoundException - When the class name of the implementation is misspelled or is missing in the classpath.
IllegalAccessException - When the class can't be accessed.
InstantiationException - When the class can't be instanciated.

newSerializer

public abstract Serializer newSerializer()
Return a new serializer.

Returns:
Return a new serializer used for creating outputs of the MIME type supported by the underlying factory.