public final class MessageBundle extends Object
java.util.ResourceBundle.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String key)
Determines whether the specified message key is contained in this
message bundle or its parent bundles.
|
boolean |
equals(Object obj)
Determines if this message bundle equals to the specified one.
|
String |
format(String key,
Locale locale,
Object... args)
Formats message for the specified key and locale.
|
String |
format(String key,
Object... args)
Formats message for the specified key and default locale.
|
String |
get(String key)
Returns message for the specified key and default locale.
|
String |
get(String key,
Locale locale)
Returns message for the specified key and locale.
|
String |
getBaseName()
Returns message bundle base name.
|
ClassLoader |
getClassLoader()
Returns class loader to be used for loading resources.
|
static MessageBundle |
getInstance(String name)
Returns message bundle for the specified base name and default class
loader.
|
static MessageBundle |
getInstance(String name,
ClassLoader loader)
Returns message bundle for the specified base name and class loader.
|
static MessageBundle |
getInstance(String name,
ClassLoader loader,
MessageBundle parent)
Returns message bundle for the specified base name, class loader and
parent bundle.
|
static MessageBundle |
getInstance(String name,
MessageBundle parent)
Returns message bundle for the specified base name, parent bundle and
default class loader.
|
MessageBundle |
getParentBundle()
Returns parent message bundle.
|
int |
hashCode()
Returns a hash code value for this message bundle.
|
boolean |
isAssignableFrom(MessageBundle bundle)
Determines whether the specified message bundle is either the same or
is a parent bundle of this bundle.
|
String |
toString()
Returns a string that contains base name of this message bundle and its
parent bundles.
|
public String getBaseName()
public ClassLoader getClassLoader()
public MessageBundle getParentBundle()
public boolean isAssignableFrom(MessageBundle bundle)
bundle - Message bundle to be checked.true if the specified message bundle is either the
same or is a parent bundle of this bundle; false
otherwise.public boolean contains(String key)
key - Message key.true if the specified message key is contained in
this message bundle or its parent bundles; false
otherwise.public String get(String key)
key - Message key.MissingResourceException - if message for the specified key is
missing.get(String, Locale)public String get(String key, Locale locale)
key - Message key.locale - Desired locale.MissingResourceException - if message for the specified key is
missing.public String format(String key, Object... args)
key - Message key.args - Message arguments.MissingResourceException - if message for the specified key is
missing.format(String, Locale, Object...)public String format(String key, Locale locale, Object... args)
key - Message key.locale - Desired locale.args - Message arguments.MissingResourceException - if message for the specified key is
missing.public int hashCode()
public boolean equals(Object obj)
public String toString()
public static MessageBundle getInstance(String name)
name - Message bundle base name.getInstance(String, ClassLoader, MessageBundle)public static MessageBundle getInstance(String name, ClassLoader loader)
name - Message bundle base name.loader - Class loader to be used for resource loading.getInstance(String, ClassLoader, MessageBundle)public static MessageBundle getInstance(String name, MessageBundle parent)
name - Message bundle base name.parent - Parent message bundle.getInstance(String, ClassLoader, MessageBundle)public static MessageBundle getInstance(String name, ClassLoader loader, MessageBundle parent)
name - Message bundle base name.loader - Class loader to be used for resource loading.parent - Parent message bundle.Copyright © 2010-2012 FoxLabs. All Rights Reserved.