org.apache.commons.i18n.bundles
Class MessageBundle
java.lang.Object
org.apache.commons.i18n.LocalizedBundle
org.apache.commons.i18n.bundles.TextBundle
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 |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TITLE
public static final java.lang.String TITLE
- See Also:
- Constant Field Values
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 messagemessageId
- 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 messagearguments
- 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 messagemessageId
- Unique message id that identifies the messagearguments
- An array of objects conaining the values that should be
inserted into the localized message.
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 textdefaultTitle
- 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.