de.dante.extex.interpreter.unit
Class LoadUnit
java.lang.Object
de.dante.util.framework.AbstractFactory
de.dante.extex.interpreter.unit.LoadUnit
- All Implemented Interfaces:
- Configurable, LogEnabled, RegistrarObserver
- public final class LoadUnit
- extends AbstractFactory
This is a factory to units from a configuration.
A unit is a configuration consisting of an optional setup class and a set of
primitives. When the unit is loaded the setup class is instantiated and run.
Then the primitives are created and registered in the context.
<unit>
<setup class="the.setup.Class"/>
<primitive>
<define name="name" class="class"/>
<define name="name" class="class">value</define>
<define name="name" class="class"/>
</primitive>
</unit>
- Version:
- $Revision: 1.1 $
- Author:
- Gerd Neugebauer
Method Summary |
void |
define(Configuration configuration,
TokenFactory tokenFactory,
Context context,
Typesetter typesetter,
java.util.logging.Logger outputLogger,
OutputStreamFactory outputFactory)
Scan a configuration and define the primitives found. |
static void |
loadUnit(Configuration configuration,
Context context,
TokenSource source,
Typesetter typesetter,
java.util.logging.Logger logger,
OutputStreamFactory outputFactory)
Prepare the primitives according to their configuration. |
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 |
loadUnit
public static void loadUnit(Configuration configuration,
Context context,
TokenSource source,
Typesetter typesetter,
java.util.logging.Logger logger,
OutputStreamFactory outputFactory)
throws ConfigurationException,
GeneralException
- Prepare the primitives according to their configuration. The given
configuration may contain sub-configurations with the name
primitives which includes the definition of primitives. Those
primitives are defined no matter if they are already defined or not.
- Parameters:
configuration
- the configurationcontext
- the interpreter contextsource
- the source for new tokenstypesetter
- the typesetterlogger
- the logger to useoutputFactory
- the output stream factory
- Throws:
ConfigurationException
- in case of a configuration error
GeneralException
- in case of an error
define
public void define(Configuration configuration,
TokenFactory tokenFactory,
Context context,
Typesetter typesetter,
java.util.logging.Logger outputLogger,
OutputStreamFactory outputFactory)
throws GeneralException,
ConfigurationException
- Scan a configuration and define the primitives found.
- Parameters:
configuration
- the configuration to scantokenFactory
- the token factory to usecontext
- the interpreter context to register the primitive intypesetter
- the typesetteroutputLogger
- the logger to produce output tooutputFactory
- the factory for new output streams
- Throws:
GeneralException
- In case of an error
ConfigurationException
- in case of an error
- ConfigurationMissingAttributeException
in case of a missing argument
- ConfigurationInstantiationException
in case of an error during instantiation
- ConfigurationClassNotFoundException
in case of a missing class
- ConfigurationWrapperException
in case of another error which is wrapped