public final class XmlResourceBundle
extends java.util.ResourceBundle
The format is as follows:
<messages> <msg id="getMessage">Get this</msg> <msg id="oneArg">one arg: {0}</msg> <msg id="twoArg">two arg: {0} {1}</msg> <msg id="threeArg">three arg: {0} {1} {2}</msg> </messages>Where the bundle gets built with the keys being the "id" attribute of the XML tag and the values being contained within the value of the <msg> tag itself. Message substitution is supported.
Constructor and Description |
---|
XmlResourceBundle()
Constructor
|
XmlResourceBundle(java.lang.String filelocation)
Creates a property resource bundle.
|
Modifier and Type | Method and Description |
---|---|
java.util.Enumeration<java.lang.String> |
getKeys()
ResourceBundle.getKeys() implemenatation
|
java.lang.Object |
handleGetObject(java.lang.String key)
Overrides the java.util.ResourceBundle.handleGetObject.
|
public XmlResourceBundle()
public XmlResourceBundle(java.lang.String filelocation) throws java.io.IOException
filelocation
- location of XML file to parsejava.io.IOException
- if the file can't be parsed/loadedpublic java.lang.Object handleGetObject(java.lang.String key)
handleGetObject
in class java.util.ResourceBundle
key
- the key to lookup out of the bundlepublic java.util.Enumeration<java.lang.String> getKeys()
getKeys
in class java.util.ResourceBundle