org.osconsulting.l10n.msgstore
Interface MessageStore
- All Known Implementing Classes:
- DBBasedMessageStore, FileBasedMessageStore
public interface MessageStore
The interface defines the interaction between the JErrHandler and the various
message stores. It encapsulates the internal working of the message store
implementations.
- Author:
- kstam
Method Summary |
java.lang.String |
getLocalizedMessage(java.lang.String key,
java.util.Locale locale)
Finds a localized error message with key JErrorCode.code and user specified locale
in the message store. |
getLocalizedMessage
java.lang.String getLocalizedMessage(java.lang.String key,
java.util.Locale locale)
throws JErrConfigError
- Finds a localized error message with key JErrorCode.code and user specified locale
in the message store. The search strategy is based on the same search
strategy applied to ResourceBundles.
The implementation of this method uses the specified locale, and the default locale
(obtained from Locale.getDefault) to generate a sequence of matches.
If the specified locale's language, country, and variant are all empty strings,
then the match defaults to the default Locale. Otherwise, the following sequence
is generated from the attribute values of the specified locale (language1, country1,
and variant1) and of the default locale (language2, country2, and variant2):
language1 + "_" + country1 + "_" + variant1
language1 + "_" + country1
language1
language2 + "_" + country2 + "_" + variant2
language2 + "_" + country2
language2
- Parameters:
key
- - the key of the localized messagelocale
- - Locale used to find the localized error message matching closest to this locale
- Returns:
- - the localized error message.
- Throws:
JErrConfigError
Copyright © 2006-2007. All Rights Reserved.