public class XMLResourceBundle
extends java.util.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>
Constructor and Description |
---|
XMLResourceBundle(java.io.InputStream in)
Creates a resource bundle from an InputStream.
|
Modifier and Type | Method and Description |
---|---|
java.util.Enumeration |
getKeys() |
java.util.Locale |
getLocale() |
static java.util.ResourceBundle |
getXMLBundle(java.lang.String baseName,
java.lang.ClassLoader loader)
Gets a resource bundle using the specified base name, default locale, and class loader.
|
static java.util.ResourceBundle |
getXMLBundle(java.lang.String baseName,
java.util.Locale locale,
java.lang.ClassLoader loader)
Gets a resource bundle using the specified base name, locale, and class loader.
|
protected java.lang.Object |
handleGetObject(java.lang.String key) |
java.lang.String |
toString() |
public XMLResourceBundle(java.io.InputStream in) throws java.io.IOException
in
- the stream to read fromjava.io.IOException
- if an I/O error occurspublic static java.util.ResourceBundle getXMLBundle(java.lang.String baseName, java.lang.ClassLoader loader) throws java.util.MissingResourceException
baseName
- the base name of the resource bundle, a fully qualified class nameloader
- the class loader from which to load the resource bundlejava.util.MissingResourceException
- if no resource bundle for the specified base name can be
foundResourceBundle.getBundle(String)
public static java.util.ResourceBundle getXMLBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader loader) throws java.util.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 bundlejava.util.MissingResourceException
- if no resource bundle for the specified base name can be
foundResourceBundle.getBundle(String, Locale, ClassLoader)
public java.util.Locale getLocale()
getLocale
in class java.util.ResourceBundle
public java.util.Enumeration getKeys()
getKeys
in class java.util.ResourceBundle
protected java.lang.Object handleGetObject(java.lang.String key)
handleGetObject
in class java.util.ResourceBundle
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.