Package org.docx4j.org.apache.fop.util
Class XMLResourceBundle
java.lang.Object
java.util.ResourceBundle
org.docx4j.org.apache.fop.util.XMLResourceBundle
This class is a ResourceBundle that loads its contents from XML files instead of properties
files (like PropertiesResourceBundle).
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>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control -
Field Summary
Fields inherited from class java.util.ResourceBundle
parent -
Constructor Summary
ConstructorsConstructorDescriptionCreates a resource bundle from an InputStream. -
Method Summary
Modifier and TypeMethodDescriptiongetKeys()static ResourceBundlegetXMLBundle(String baseName, ClassLoader loader) Gets a resource bundle using the specified base name, default locale, and class loader.static ResourceBundlegetXMLBundle(String baseName, Locale locale, ClassLoader loader) Gets a resource bundle using the specified base name, locale, and class loader.protected ObjecthandleGetObject(String key) toString()Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParent
-
Constructor Details
-
XMLResourceBundle
Creates a resource bundle from an InputStream.- Parameters:
in- the stream to read from- Throws:
IOException- if an I/O error occurs
-
-
Method Details
-
getXMLBundle
public static ResourceBundle getXMLBundle(String baseName, ClassLoader loader) throws MissingResourceException Gets a resource bundle using the specified base name, default locale, and class loader.- Parameters:
baseName- the base name of the resource bundle, a fully qualified class nameloader- the class loader from which to load the resource bundle- Returns:
- a resource bundle for the given base name and the default locale
- Throws:
MissingResourceException- if no resource bundle for the specified base name can be found- See Also:
-
getXMLBundle
public static ResourceBundle getXMLBundle(String baseName, Locale locale, ClassLoader loader) throws MissingResourceException Gets a resource bundle using the specified base name, locale, and class loader.- Parameters:
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 bundle- Returns:
- a resource bundle for the given base name and locale
- Throws:
MissingResourceException- if no resource bundle for the specified base name can be found- See Also:
-
getLocale
- Overrides:
getLocalein classResourceBundle
-
getKeys
- Specified by:
getKeysin classResourceBundle
-
handleGetObject
- Specified by:
handleGetObjectin classResourceBundle
-
toString
-