de.dante.extex.language.impl
Class BaseLanguageManager

java.lang.Object
  extended byde.dante.util.framework.AbstractFactory
      extended byde.dante.extex.language.impl.BaseLanguageManager
All Implemented Interfaces:
Configurable, LanguageManager, LogEnabled, RegistrarObserver, java.io.Serializable
Direct Known Subclasses:
LoadingLanguageManager

public class BaseLanguageManager
extends AbstractFactory
implements LanguageManager, java.io.Serializable

This class manages the HyphenationTables. It is a container which can be asked to provide an appropriate instance. This instance is either taken from existing instances or a new instance is created.

Configuration

This instance is configurable. The configuration is used to select the appropriate class and optional parameters for a requested instance. In this respect this class makes best use of the infrastructure of the AbstractFactory.

Version:
$Revision: 1.10 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
BaseLanguageManager()
          Creates a new object.
 
Method Summary
protected  Language createLanguage(java.lang.String name)
          Create a new language and put it into the table.
 Language getLanguage(java.lang.String name)
          Return the Language for a given name.
protected  Localizer getLocalizer()
          Getter for a localizer
protected  java.util.Map getTables()
          Getter for the tables.
protected  java.lang.Object readResolve()
          Restore the internal state when the instance is loaded from file.
 
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
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

BaseLanguageManager

public BaseLanguageManager()
Creates a new object.

Method Detail

createLanguage

protected Language createLanguage(java.lang.String name)
                           throws ConfigurationException
Create a new language and put it into the table.

Parameters:
name - the name of the language
Returns:
the new instance of a language
Throws:
ConfigurationException - in case of a configuration error

getLanguage

public Language getLanguage(java.lang.String name)
                     throws ConfigurationException
Return the Language for a given name.

If there is no language present with the given name then a new one is created.

The index in TeX is the language number as String. This implementation does not have this restriction. The name can be any string.

The proposal is to use a natural number for backward compatibility and ISO language codes otherwise.

Specified by:
getLanguage in interface LanguageManager
Parameters:
name - the name for which the language is requested
Returns:
the language for the given name
Throws:
ConfigurationException - in case of an error in the configuration
See Also:
LanguageManager.getLanguage( java.lang.String)

getLocalizer

protected Localizer getLocalizer()
Getter for a localizer

Returns:
the localizer

getTables

protected java.util.Map getTables()
Getter for the tables.

Returns:
the tables map

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Restore the internal state when the instance is loaded from file.

Returns:
the object which should be used instead of the one read
Throws:
java.io.ObjectStreamException - in case of an error