org.extex.engine.typesetter
Class TypesetterFactory
java.lang.Object
org.extex.framework.AbstractFactory
org.extex.engine.typesetter.TypesetterFactory
- All Implemented Interfaces:
- Configurable, LogEnabled, RegistrarObserver, ResourceAware
public class TypesetterFactory
- extends AbstractFactory
This is the factory for instances of
Typesetter. This factory inherits
its properties from the
AbstractFactory. Among them the
support for configuration and logging.
Configuration
Mainly the configuration needs to specify which class to use for the
Typesetter. 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.
<Typesetter default="TeX">
<TeX class="org.extex.typesetter.impl.TypesetterImpl"
direction="lr">
<PageBuilder class="org.extex.typesetter.pageBuilder.impl.PageBuilderImpl"/>
<ParagraphBuilder class="org.extex.typesetter.paragraphBuilder.texImpl.TeXParagraphBuilder">
<Hyphenator class="org.extex.typesetter.paragraphBuilder.texImpl.TeXParagraphBuilder"/>
</ParagraphBuilder>
<NodeFactory class="org.extex.typesetter.type.node.factory.CachingNodeFactory"/>
</TeX>
<develop class="org.extex.typesetter.impl.TypesetterImpl"
direction="lr">
<PageBuilder class="org.extex.typesetter.pageBuilder.impl.PageBuilderImpl"/>
<ParagraphBuilder class="org.extex.typesetter.(new JUnitCore())"/>
<NodeFactory class="org.extex.typesetter.type.node.factory.CachingUnicodeNodeFactory"/>
</develop>
</Typesetter>
The named class need to implement the interface
Typesetter. 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.
- Version:
- $Revision: 4404 $
- Author:
- Gerd Neugebauer
| 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 |
TypesetterFactory
public TypesetterFactory()
- Creates a new object.
newInstance
public Typesetter newInstance(java.lang.String type,
Context context,
BackendDriver backend,
Interpreter interpreter)
throws TypesetterException
- Get an instance of a typesetter.
- Parameters:
type - the symbolic name of the configuration to usecontext - the interpreter contextbackend - the back-end driverinterpreter - the interpreter
- Returns:
- a new typesetter
- Throws:
ConfigurationException - in case of an configuration error
TypesetterException - in case of another error