public class XMLResourceBundle extends ResourceBundle
The XML format for this resource bundle implementation is the following (the same as Apache Cocoon's XMLResourceBundle):
<catalogue xml:lang="en"> <message key="key1">Message <br/> Value 1</message> <message key="key2">Message <br/> Value 1</message> ... </catalogue>
ResourceBundle.Controlparent| Constructor and Description |
|---|
XMLResourceBundle(InputStream in)
Creates a resource bundle from an InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
Enumeration |
getKeys() |
Locale |
getLocale() |
static ResourceBundle |
getXMLBundle(String baseName,
ClassLoader loader)
Gets a resource bundle using the specified base name, default locale, and class loader.
|
static ResourceBundle |
getXMLBundle(String baseName,
Locale locale,
ClassLoader loader)
Gets a resource bundle using the specified base name, locale, and class loader.
|
protected Object |
handleGetObject(String key) |
String |
toString() |
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParentpublic XMLResourceBundle(InputStream in) throws IOException
in - the stream to read fromIOException - if an I/O error occurspublic static ResourceBundle getXMLBundle(String baseName, ClassLoader loader) throws MissingResourceException
baseName - the base name of the resource bundle, a fully qualified class nameloader - the class loader from which to load the resource bundleMissingResourceException - if no resource bundle for the specified base name can be
foundResourceBundle.getBundle(String)public static ResourceBundle getXMLBundle(String baseName, Locale locale, ClassLoader loader) throws MissingResourceException
baseName - the base name of the resource bundle, a fully qualified class namelocale - the locale for which a resource bundle is desiredloader - the class loader from which to load the resource bundleMissingResourceException - if no resource bundle for the specified base name can be
foundResourceBundle.getBundle(String, Locale, ClassLoader)public Locale getLocale()
getLocale in class ResourceBundlepublic Enumeration getKeys()
getKeys in class ResourceBundleprotected Object handleGetObject(String key)
handleGetObject in class ResourceBundleCopyright © 2020 Apache Software Foundation. All rights reserved.