org.extex.interpreter.context
Class ContextFactory

java.lang.Object
  extended by org.extex.framework.AbstractFactory
      extended by org.extex.interpreter.context.ContextFactory
All Implemented Interfaces:
Configurable, LogEnabled, RegistrarObserver, ResourceAware

public class ContextFactory
extends AbstractFactory

This class provides a factory for a Context.

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

Version:
$Revision$
Author:
Gerd Neugebauer

Field Summary
 
Fields inherited from class org.extex.framework.AbstractFactory
CLASS_ATTRIBUTE, DEFAULT_ATTRIBUTE, SELECT_ATTRIBUTE
 
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 org.extex.framework.AbstractFactory
configure, configure, createInstance, createInstance, createInstance, createInstance, createInstanceForConfiguration, createInstanceForConfiguration, createInstanceForConfiguration, enableLogging, enableLogging, getConfiguration, getLogger, getResourceFinder, reconnect, selectConfiguration, setResourceFinder
 
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