| java.lang.Object jacareto.system.Language
Language | public class Language (Code) | | A storage for texts depending on a language (keyword -> text mappings like the ResourceBundle
class of the java API) The mapping can be given as a enhanced hashtable object. All values will
be interpreted as Strings. TODO: Default language if a string cannot be found in the specified
language
author: Christian Spannagel version: 1.01 |
Constructor Summary | |
public | Language(EnhancedHashtable mapping, Logger logger) Creates a new language object with the given mapping and the given logger instance. | public | Language() Creates a new language object with an empty mapping and the root logger. | public | Language(Customization customization, String basedir, String language, Logger logger) Creates a new language object which loads the mapping from a properties file specified in
the customization instance for a given language. | public | Language(Customization customization, String language, Logger logger) Creates a new language object which loads the mapping from a properties file specified in
the customization instance for a given language. |
Language | public Language(EnhancedHashtable mapping, Logger logger)(Code) | | Creates a new language object with the given mapping and the given logger instance.
Parameters: mapping - the mapping of keywords to language dependent texts Parameters: logger - the logger instance for error messages |
Language | public Language()(Code) | | Creates a new language object with an empty mapping and the root logger.
|
Language | public Language(Customization customization, String basedir, String language, Logger logger) throws IOException, HashtableException(Code) | | Creates a new language object which loads the mapping from a properties file specified in
the customization instance for a given language.
Parameters: customization - the customization instance with th language -> properties filenamemapping Parameters: basedir - the basedir for the properties files Parameters: language - the language ("en" for English, for example) Parameters: logger - the logger instance throws: IOException - if the language file could not be read throws: HashtableException - if there is no setting for the language file map or the languagekey is not contained in the map |
Language | public Language(Customization customization, String language, Logger logger) throws IOException, HashtableException(Code) | | Creates a new language object which loads the mapping from a properties file specified in
the customization instance for a given language.
Parameters: customization - the customization instance with th language -> properties filenamemapping Parameters: language - the language ("en" for English, for example) Parameters: logger - the logger instance throws: IOException - if the language file could not be read throws: HashtableException - if there is no setting for the language file map or the languagekey is not contained in the map |
containsKey | public boolean containsKey(String key)(Code) | | Returns whether or not a key is contained.
Parameters: key - the key true if the key is contained, otherwise false |
getIdentifier | public String getIdentifier()(Code) | | Returns the identifier of this language (en, for example).
the identifier string |
getLogger | public Logger getLogger()(Code) | | Returns the current logger instance.
DOCUMENT ME! |
getString | public String getString(String key)(Code) | | Returns the text belonging to a given keyword. If the key does not exist or the text is
null , an error message will be printed and the empty string. will be returned.
Parameters: key - the keyword the text belonging to the keyword, or the empty string if the key does not exist orthe text is null . |
setIdentifier | public void setIdentifier(String idstring)(Code) | | Sets the identifier of this language (en, for example.
Parameters: idstring - the identifier string |
setLogger | public void setLogger(Logger logger)(Code) | | Sets the logger instance
Parameters: logger - the new logger object |
setMapping | public void setMapping(EnhancedHashtable mapping)(Code) | | Sets the mapping
Parameters: mapping - the new mapping |
setString | public void setString(String key, String value)(Code) | | Sets a value for a key.
Parameters: key - the keyword Parameters: value - the value |
|
|