public class Messages extends Object
Constructor and Description |
---|
Messages(File propertiesFile)
Constructor: opens the file with the given descriptor and loads all
messages.
|
Messages(File propertiesFile,
Locale initialLocale)
Constructor: opens the file with the given descriptor and loads all
messages.
|
Messages(URL propertiesURL)
Constructor: opens the file with the given descriptor and loads all
messages.
|
Messages(URL propertiesURL,
Locale initialLocale)
Constructor: opens the file with the given descriptor and loads all
messages.
|
Modifier and Type | Method and Description |
---|---|
Locale |
getCurrentLocale()
Get the current Locale used for messages.
|
String |
getString(String key)
Get the value for a given key.
|
void |
setLocale(Locale loc)
Try to change the locale for messages.
|
public Messages(File propertiesFile) throws IOException, IllegalArgumentException
propertiesFile
- the properties file to use to load the messages.IOException
- if the propertiesFile does not existIllegalArgumentException
- if propertiesFile has incorrect extensionpublic Messages(File propertiesFile, Locale initialLocale) throws IOException, IllegalArgumentException
propertiesFile
- the properties file to use to load the messages.initialLocale
- the initialLocale to be used.IOException
- if the propertiesFile does not exist (but not if the
internationalized file does not exist)IllegalArgumentException
- if propertiesFile has incorrect extensionpublic Messages(URL propertiesURL) throws IOException, IllegalArgumentException
propertiesURL
- the properties file to use to load the messages.IOException
- if the propertiesURL does not existIllegalArgumentException
- if propertiesURL has incorrect extensionpublic Messages(URL propertiesURL, Locale initialLocale) throws IOException, IllegalArgumentException
propertiesURL
- the properties file to use to load the messages.initialLocale
- the initialLocale to be used.IOException
- if the propertiesURL does not exist (but not if the
internationalized file does not exist)IllegalArgumentException
- if propertiesURL has incorrect extensionCopyright © 2018 universAAL Consortium. All rights reserved.