public class OrderedResourceBundle
extends java.lang.Object
java.util.ResourceBundle
for more information.
Unlike other types of resource bundle, OrderedResourceBundle
is not
usually subclassed. Instead, the properties files containing the resource data
are supplied. OrderedResourceBundle.getBundle
will automatically look for the appropriate properties file and create an
OrderedResourceBundle
that refers to it. See
java.util.ResourceBundle.getBundle()
for a complete description
of the search and instantiation strategy.
Constructor and Description |
---|
OrderedResourceBundle(java.io.InputStream stream)
Construct an OrderedResourceBundle.
|
Modifier and Type | Method and Description |
---|---|
static OrderedResourceBundle |
getBundle(java.lang.String baseName)
Get a resource bundle using the specified base name and the default
locale.
|
java.util.Iterator |
getKeys()
Get an Iterator over the Set of keys, allowing retrieval of the keys in
the original order as listed in the properties file.
|
java.lang.String |
getString(java.lang.String key)
Get a string for the given key from this resource bundle.
|
public OrderedResourceBundle(java.io.InputStream stream) throws java.io.IOException, java.lang.NullPointerException
stream
- InputStream for reading the java properties file from which
this object will take its values. The stream is closed
by this constructor.java.io.IOException
- if there is a problem reading the InputStreamjava.lang.NullPointerException
- if the InputStream is nullpublic static OrderedResourceBundle getBundle(java.lang.String baseName) throws java.io.IOException, java.util.MissingResourceException, java.lang.NullPointerException
java.util.ResourceBundle
for a complete
description of the search and instantiation strategy.baseName
- String denoting the name of the properties file that will be
read to populate this ResourceBundle.MyPropsFile_en_US.properties
will be sought on
the classpath.org/mydomain/pkg/MyPropsFile_en_US.properties
will be sought on the classpath.java.io.IOException
- if there is a problem reading the filejava.util.MissingResourceException
- if the file cannot be foundjava.lang.NullPointerException
- if baseName is nullpublic java.lang.String getString(java.lang.String key)
key
- the key for the desired stringpublic java.util.Iterator getKeys()