org.apache.commons.i18n
Class LocalizedBundle
java.lang.Object
org.apache.commons.i18n.LocalizedBundle
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- TextBundle
- public class LocalizedBundle
- extends Object
- implements Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ID
public static final String ID
- See Also:
- Constant Field Values
ARGUMENTS
public static final String ARGUMENTS
- See Also:
- Constant Field Values
id
protected String id
arguments
protected Object[] arguments
LocalizedBundle
public LocalizedBundle(String messageId)
- Parameters:
messageId
- The messageId refers the corresponding bundle in the file containing
the localized messages. The format of the message file depends on the implementation of the
MessageManager.
LocalizedBundle
public LocalizedBundle(String messageId,
Object[] arguments)
- Parameters:
messageId
- The messageId refers the corresponding bundle in the file containing
the localized messages. The format of the message file depends on the implementation of the
MessageManager.arguments
- An array of objects containing argument for the messages. These arguments
are used to insert dynamic values into the localized messages.
getId
public String getId()
- Returns:
- returns the id of this bundle
getArguments
public Object[] getArguments()
- Returns:
- returns the arguments associated with this message bundle
getText
public String getText(String key,
Locale locale)
throws MessageNotFoundException
- Parameters:
key
- the key of the specific message entry in the message bundlelocale
- the locale for that this message should be rendered
- Returns:
- returns the localized text
- Throws:
MessageNotFoundException
- if an entry with the given key can not be found
in this bundle
getText
public String getText(String key,
String defaultText,
Locale locale)
- Parameters:
key
- the key of the specific message entry in the message bundlelocale
- the locale for that this message should be rendereddefaultText
- the text to be returned if no entry was found for the given key
- Returns:
- returns the localized text
Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.