de.dante.extex.backend.documentWriter
Class DocumentWriterFactory

java.lang.Object
  extended byde.dante.util.framework.AbstractFactory
      extended byde.dante.extex.backend.documentWriter.DocumentWriterFactory
All Implemented Interfaces:
Configurable, LogEnabled, RegistrarObserver

public class DocumentWriterFactory
extends AbstractFactory

This is the factory to provide an instance of a document writer.

The class to be instantiated can implements one or more interfaces which trigger special actions:

Configurable
If this interface is implemented then a Configuration is passed in with the interface method.
LogEnabled
If this interface is implemented then a Logger is passed in with the interface method.
Localizable
If this interface is implemented then a Localizer is passed in with the interface method.
SingleDocumentStream
If this interface is implemented then a OutputStream is passed in with the interface method.
MultipleDocumentStream
If this interface is implemented then a OutputStreamFactory is passed in with the interface method.

Version:
$Revision: 1.4 $
Author:
Gerd Neugebauer

Constructor Summary
DocumentWriterFactory(Configuration configuration, java.util.logging.Logger logger)
          Creates a new object.
 
Method Summary
 DocumentWriter newInstance(java.lang.String type, DocumentWriterOptions options, OutputStreamFactory outFactory)
          Provide a new instance of a document writer.
 
Methods inherited from class de.dante.util.framework.AbstractFactory
configure, configure, createInstance, createInstance, createInstance, createInstanceForConfiguration, createInstanceForConfiguration, createInstanceForConfiguration, enableLogging, enableLogging, getConfiguration, getLogger, reconnect, selectConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentWriterFactory

public DocumentWriterFactory(Configuration configuration,
                             java.util.logging.Logger logger)
                      throws ConfigurationException
Creates a new object.

Parameters:
configuration - the configuration to use for the factory
logger - the logger
Throws:
ConfigurationException - in case of an error
Method Detail

newInstance

public DocumentWriter newInstance(java.lang.String type,
                                  DocumentWriterOptions options,
                                  OutputStreamFactory outFactory)
                           throws DocumentWriterException,
                                  ConfigurationException
Provide a new instance of a document writer. The new instance is initiated with the sub-configuration describing it.

If the generated instance implements the interface SingleDocumentStream then the method setOutputStream of this interface is invoked.

If the generated instance implements the interface MultipleDocumentStream then the method setOutputStreamFactory of this interface is invoked.

Parameters:
type - the type of the document writer
options - the dynamic access to the readable part of the context
outFactory - the factory for further output streams
Returns:
the new instance
Throws:
DocumentWriterException - in case of a problem
ConfigurationException - in case of a configuration problem