org.extex.interpreter
Class LoadUnit
java.lang.Object
org.extex.framework.AbstractFactory
org.extex.interpreter.LoadUnit
- All Implemented Interfaces:
- Configurable, LogEnabled, RegistrarObserver, ResourceAware
public final class LoadUnit
- extends AbstractFactory
This is a factory load 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 name="the name"
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: 4770 $
- Author:
- Gerd Neugebauer
|
Method Summary |
void |
define(Configuration configuration,
TokenFactory tokenFactory,
Context context,
Typesetter typesetter,
java.util.logging.Logger outputLogger,
OutputStreamFactory outputFactory,
ResourceFinder resourcefinder)
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,
ResourceFinder resourcefinder)
Prepare the primitives according to their configuration. |
| 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 |
loadUnit
public static void loadUnit(Configuration configuration,
Context context,
TokenSource source,
Typesetter typesetter,
java.util.logging.Logger logger,
OutputStreamFactory outputFactory,
ResourceFinder resourcefinder)
throws 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 factoryresourcefinder - the resource finder
- 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,
ResourceFinder resourcefinder)
throws GeneralException
- 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 streamsresourcefinder - the resource finder
- 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