org.extex.interpreter.context
Class ContextFactory

java.lang.Object
  extended by AbstractFactory
      extended by org.extex.interpreter.context.ContextFactory

public class ContextFactory
extends AbstractFactory

This class provides a factory for a Context.

  <Context class="the.package.TheClass">
  </Context>
 

Version:
$Revision$
Author:
Gerd Neugebauer

Constructor Summary
ContextFactory(Configuration configuration, java.util.logging.Logger logger)
          Creates a new object.
 
Method Summary
 Context newInstance(java.lang.String type)
          Get an instance of a context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextFactory

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

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

newInstance

public Context newInstance(java.lang.String type)
                    throws ConfigurationException
Get an instance of a context. 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.

Parameters:
type - the type to use
Returns:
a new context
Throws:
ConfigurationException - in case of an configuration error