org.osconsulting.l10n.msgstore
Class FileBasedMessageStore

java.lang.Object
  extended by org.osconsulting.l10n.msgstore.FileBasedMessageStore
All Implemented Interfaces:
MessageStore

public class FileBasedMessageStore
extends java.lang.Object
implements MessageStore


Constructor Summary
FileBasedMessageStore(java.util.HashMap<java.lang.String,java.lang.String> properties)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBasedMessageStore

public FileBasedMessageStore(java.util.HashMap<java.lang.String,java.lang.String> properties)
Method Detail

getLocalizedMessage

public java.lang.String getLocalizedMessage(java.lang.String key,
                                            java.util.Locale locale)
Description copied from interface: MessageStore
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

Specified by:
getLocalizedMessage in interface MessageStore
Parameters:
key - - the key of the localized message
locale - - Locale used to find the localized error message matching closest to this locale
Returns:
- the localized error message.


Copyright © 2006-2007. All Rights Reserved.