Class ErrorHandlerFactory

  extended byde.dante.util.framework.AbstractFactory
      extended byde.dante.extex.interpreter.ErrorHandlerFactory
All Implemented Interfaces:
Configurable, LogEnabled, RegistrarObserver

public class ErrorHandlerFactory
extends AbstractFactory

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


Mainly the configuration needs to specify which class to use for the ErrorHandler. 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.

   <ErrorHandler default="ExTeX">
     <ExTeX class="de.dante.extex.main.errorHandler.ErrorHandlerImpl">
       <EditHandler class="de.dante.extex.main.errorHandler.editHandler.EditHandlerTeXImpl"/>
     <TeX class="de.dante.extex.main.errorHandler.ErrorHandlerTeXImpl">
       <EditHandler class="de.dante.extex.main.errorHandler.editHandler.EditHandlerTeXImpl"/>
     <extex class="de.dante.extex.main.errorHandler.ErrorHandlerImpl"/>
     <tex class="de.dante.extex.main.errorHandler.ErrorHandlerTeXImpl"/>

The named class need to implement the interface ErrorHandler. 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.

$Revision: 1.5 $
Gerd Neugebauer

Constructor Summary
          Creates a new object.
ErrorHandlerFactory(Configuration configuration)
          Creates a new object and configures it according to the parameter.
Method Summary
 ErrorHandler newInstance(java.lang.String type)
          Get an instance of an error handler.
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


public ErrorHandlerFactory()
Creates a new object.


public ErrorHandlerFactory(Configuration configuration)
                    throws ConfigurationException
Creates a new object and configures it according to the parameter.

configuration - the configuration to use
ConfigurationException - in case of an error during configuration
Method Detail


public ErrorHandler newInstance(java.lang.String type)
                         throws ConfigurationException
Get an instance of an error handler. This method selects one of the entries in the configuration. The selection is done with the help of a type String. If the type is null or the empty string then the default from the configuration is used.

type - the type to use
a new error handler
ConfigurationException - in case of an configuration error