org.apache.commons.i18n.bundles
Class MessageBundle

java.lang.Object
  extended by org.apache.commons.i18n.LocalizedBundle
      extended by org.apache.commons.i18n.bundles.TextBundle
          extended by org.apache.commons.i18n.bundles.MessageBundle
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ErrorBundle

public class MessageBundle
extends TextBundle

The MessageBundle groups together title and text.

See Also:
Serialized Form

Field Summary
static java.lang.String TITLE
           
 
Fields inherited from class org.apache.commons.i18n.bundles.TextBundle
TEXT
 
Fields inherited from class org.apache.commons.i18n.LocalizedBundle
arguments, id, ID, providerId
 
Constructor Summary
MessageBundle(java.lang.String messageId)
           
MessageBundle(java.lang.String messageId, java.lang.Object[] arguments)
           
MessageBundle(java.lang.String providerId, java.lang.String messageId)
           
MessageBundle(java.lang.String providerId, java.lang.String messageId, java.lang.Object[] arguments)
           
 
Method Summary
 java.lang.String getTitle(java.util.Locale locale)
           
 java.lang.String getTitle(java.util.Locale locale, java.lang.String defaultTitle)
           
 
Methods inherited from class org.apache.commons.i18n.bundles.TextBundle
getText, getText
 
Methods inherited from class org.apache.commons.i18n.LocalizedBundle
getArguments, getEntry, getEntry, getId, getProviderId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TITLE

public static final java.lang.String TITLE
See Also:
Constant Field Values
Constructor Detail

MessageBundle

public MessageBundle(java.lang.String messageId)
Parameters:
messageId - Unique message id that identifies the message

MessageBundle

public MessageBundle(java.lang.String providerId,
                     java.lang.String messageId)
Parameters:
providerId - The name of the message provider (i.e. source) to use for the message
messageId - Unique message id that identifies the message

MessageBundle

public MessageBundle(java.lang.String messageId,
                     java.lang.Object[] arguments)
Parameters:
messageId - Unique message id that identifies the message
arguments - An array of objects conaining the values that should be inserted into the localized message.

MessageBundle

public MessageBundle(java.lang.String providerId,
                     java.lang.String messageId,
                     java.lang.Object[] arguments)
Parameters:
providerId - The name of the message provider (i.e. source) to use for the message
messageId - Unique message id that identifies the message
arguments - An array of objects conaining the values that should be inserted into the localized message.
Method Detail

getTitle

public java.lang.String getTitle(java.util.Locale locale)
                          throws MessageNotFoundException
Parameters:
locale - The locale that is used to find the appropriate localized text
Returns:
returns the localized message entry with the key title
Throws:
MessageNotFoundException - is thrown if no entry with key title could be found in the message bundle identified by the given message identifier

getTitle

public java.lang.String getTitle(java.util.Locale locale,
                                 java.lang.String defaultTitle)
Parameters:
locale - The locale that is used to find the appropriate localized text
defaultTitle - The default text will be returned, if no entry with key title could be found in the message bundle identified by the given message identifier
Returns:
returns the localized message entry with the key title


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