org.apache.commons.i18n
Interface MessageProvider

All Known Implementing Classes:
JdbcMessageProvider, ResourceBundleMessageProvider, XMLMessageProvider

public interface MessageProvider

The MessageProvider interface specifies the methods that must be implemented by each message provider in order to be pluggable into the MessageManager.


Method Summary
 java.util.Map getEntries(java.lang.String id, java.util.Locale locale)
           
 java.lang.String getText(java.lang.String id, java.lang.String entry, java.util.Locale locale)
           
 

Method Detail

getText

java.lang.String getText(java.lang.String id,
                         java.lang.String entry,
                         java.util.Locale locale)
Parameters:
id - unique id that specifies a particular message
entry - specifies a particular entry in the specified message
locale - the locale for which this text should be provided
Returns:
returns the localized message entry matching the given message id, entry key and locale. If no match is found for the given locale, the parent locale is used, and finally the default. If the id is found but the entry is not, null is returned.
Throws:
MessageNotFoundException - thrown if no message exists matching the given id

getEntries

java.util.Map getEntries(java.lang.String id,
                         java.util.Locale locale)
                         throws MessageNotFoundException
Parameters:
id - unique id that specifies a particular message
locale - the locale for which to return the entries
Returns:
returns a map <entry(String) -> localized text(String) of message entries matching the given message id and locale
Throws:
MessageNotFoundException - thrown if no message could be found matching the given message id


Copyright 2004-2008 The Apache Software Foundation. All Rights Reserved.