org.universAAL.middleware.container.osgi.util
Class Messages
java.lang.Object
org.universAAL.middleware.container.utils.ModuleConfigHome
org.universAAL.middleware.container.osgi.util.BundleConfigHome
org.universAAL.middleware.container.osgi.util.Messages
public class Messages
- extends BundleConfigHome
An extension of configuration file handling. The configuration file consists
of lines with key-value pairs (called 'messages'). In addition to simplify
the reading of configuration files, this class also handles messages in
different files representing the messages in different languages. When a
message is not available in the localized language, the corresponding value
for the default language is returned.
The default file name is messages.properties, the file name for a
different language include a language code as lowercase ISO 639 code, e.g.
for english, the file name would be messages_en.properties.
- Author:
- mtazari, Carsten Stockloew, amedrano
Constructor Summary |
Messages(String id)
Constructor: opens the file with the given ID and loads all messages. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Messages
public Messages(String id)
throws IOException
- Constructor: opens the file with the given ID and loads all messages.
- Parameters:
id
- The ID for the configuration file, see
org.universAAL.middleware.BundleConfigHome.ConfFile#ConfFile(String)
- Throws:
IOException
setLocale
public void setLocale(Locale loc)
- Change the locale for messages.
- Parameters:
loc
-
getString
public String getString(String key)
- Get the value for a given key.
- Parameters:
key
- The key.
- Returns:
- The value.
Copyright © 2014 universAAL Consortium. All Rights Reserved.