de.dante.extex.typesetter
Class TypesetterFactory

java.lang.Object
  extended byde.dante.util.framework.AbstractFactory
      extended byde.dante.extex.typesetter.TypesetterFactory
All Implemented Interfaces:
Configurable, LogEnabled, RegistrarObserver

public class TypesetterFactory
extends AbstractFactory

This is the factory for instances of Typesetter. This factory inherits its properties from the AbstractFactory. Among them the support for configuration and logging.

Configuration

Mainly the configuration needs to specify which class to use for the Typesetter. The configuration provides a mapping from a type name to the sub-configuration to be used. The name of the class is given as the argument class of the sub-configuration as shown below.

   <Typesetter default="TeX">
     <TeX class="de.dante.extex.typesetter.impl.TypesetterImpl"
          direction="lr">
       <PageBuilder class="de.dante.extex.typesetter.pageBuilder.impl.PageBuilderImpl"/>
       <ParagraphBuilder class="de.dante.extex.typesetter.paragraphBuilder.texImpl.TeXParagraphBuilder">
         <Hyphenator class="de.dante.extex.typesetter.paragraphBuilder.texImpl.TeXParagraphBuilder"/>
       </ParagraphBuilder>
       <NodeFactory class="de.dante.extex.typesetter.type.node.factory.CachingNodeFactory"/>
     </TeX>
     <develop class="de.dante.extex.typesetter.impl.TypesetterImpl"
            direction="lr">
       <PageBuilder class="de.dante.extex.typesetter.pageBuilder.impl.PageBuilderImpl"/>
       <ParagraphBuilder class="de.dante.extex.typesetter.paragraphBuilder.trivial.TrivialBuilder"/>
       <NodeFactory class="de.dante.extex.typesetter.type.node.factory.CachingUnicodeNodeFactory"/>
     </develop>
   </Typesetter>
  

The named class need to implement the interface Typesetter. If this interface is not implemented an error is raised.

The configuration is passed down to the new instance if it implements the interface Configurable.

If the class implements the interface LogEnabled then a logger is passed to the new instance. For this purpose the factory itself is log enabled to receive the logger.

Version:
$Revision: 1.26 $
Author:
Gerd Neugebauer

Constructor Summary
TypesetterFactory()
          Creates a new object.
 
Method Summary
 Typesetter newInstance(java.lang.String type, Context context, BackendDriver backend)
          Get an instance of a typesetter.
 
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

TypesetterFactory

public TypesetterFactory()
Creates a new object.

Method Detail

newInstance

public Typesetter newInstance(java.lang.String type,
                              Context context,
                              BackendDriver backend)
                       throws TypesetterException,
                              ConfigurationException
Get an instance of a typesetter.

Parameters:
type - the symbolic name of the configuration to use
context - the interpreter context
backend - the back-end driver
Returns:
a new typesetter
Throws:
ConfigurationException - in case of an configuration error
TypesetterException - in case of another error