org.clapper.util.misc
Class XResourceBundle
- java.lang.Object
-
- java.util.ResourceBundle
-
- org.clapper.util.misc.XResourceBundle
-
public final class XResourceBundle extends java.util.ResourceBundleThis class is an extended version of the JDK's ResourceBundle class, providing some extra methods. It can be instantiated by wrapping an existing ResourceBundle object, or by using the static getBundle() methods, which are identical to the ResourceBundle versions.
-
-
Constructor Summary
Constructors Constructor and Description XResourceBundle(java.util.ResourceBundle bundle)Create a new XResourceBundle that wraps an existing ResourceBundle.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.Enumeration<java.lang.String>getKeys()Returns an enumeration of the keys.java.lang.StringgetString(java.lang.String key, java.lang.String defaultValue)Get a string for the given key from this resource bundle, applying a default if not found.static XResourceBundlegetXResourceBundle(java.lang.String baseName)Analogous to the equivalent getBundle method in the JDK's ResourceBundle class.static XResourceBundlegetXResourceBundle(java.lang.String baseName, java.util.Locale locale)Analogous to the equivalent getBundle method in the JDK's ResourceBundle class.static XResourceBundlegetXResourceBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader classLoader)Analogous to the equivalent getBundle method in the JDK's ResourceBundle class.
-
-
-
Constructor Detail
-
XResourceBundle
public XResourceBundle(java.util.ResourceBundle bundle)
Create a new XResourceBundle that wraps an existing ResourceBundle.- Parameters:
bundle- the ResourceBundle to wrap.
-
-
Method Detail
-
getXResourceBundle
public static XResourceBundle getXResourceBundle(java.lang.String baseName)
Analogous to the equivalent getBundle method in the JDK's ResourceBundle class.- Parameters:
baseName- base name of the bundle to retrieve, a fully qualified class name- Returns:
- the bundle
- Throws:
java.lang.NullPointerException- if baseName is nulljava.util.MissingResourceException- no bundle available
-
getXResourceBundle
public static XResourceBundle getXResourceBundle(java.lang.String baseName, java.util.Locale locale)
Analogous to the equivalent getBundle method in the JDK's ResourceBundle class.- Parameters:
baseName- base name of the bundle to retrieve, a fully qualified class namelocale- the locale for which a resource bundle is desired- Returns:
- the bundle
- Throws:
java.lang.NullPointerException- if baseName is nulljava.util.MissingResourceException- no bundle available
-
getXResourceBundle
public static XResourceBundle getXResourceBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader classLoader)
Analogous to the equivalent getBundle method in the JDK's ResourceBundle class.- Parameters:
baseName- base name of the bundle to retrieve, a fully qualified class namelocale- the locale for which a resource bundle is desiredclassLoader- class loader to use- Returns:
- the bundle
- Throws:
java.lang.NullPointerException- if baseName is nulljava.util.MissingResourceException- no bundle available
-
getKeys
public java.util.Enumeration<java.lang.String> getKeys()
Returns an enumeration of the keys.- Specified by:
getKeysin classjava.util.ResourceBundle- Returns:
- the enumeration of the keys
-
getString
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)Get a string for the given key from this resource bundle, applying a default if not found. There's no equivalent for this method in the ResourceBundle class.- Parameters:
key- the key for the desired stringdefaultValue- the default value, if not found- Returns:
- the value for the key, which may be the default
-
-
DMelt 3.0 © DataMelt by jWork.ORG