|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.util.OrderedResourceBundle
public class OrderedResourceBundle
Manage the resources for a locale using a set of static strings from a property file.
See 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.
Field Summary | |
---|---|
private static java.lang.String |
FWD_SLASH
|
private static java.lang.String |
keyValueSeparators
|
private java.util.LinkedHashMap |
orderedMap
|
private static java.lang.String |
PROPS_EXT
|
private static java.lang.String |
strictKeyValueSeparators
|
private static java.lang.String |
UNDERSCORE
|
private static java.lang.String |
whiteSpaceChars
|
Constructor Summary | |
---|---|
OrderedResourceBundle(java.io.InputStream stream)
Construct an OrderedResourceBundle. |
Method Summary | |
---|---|
private boolean |
continueLine(java.lang.String line)
|
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. |
private java.util.LinkedHashMap |
getPropsAsOrderedMap(java.io.BufferedReader propsReader)
Get the properties as an ordered map. |
private static java.lang.String |
getPropsFileNamePlusLocale(java.lang.String baseName)
|
java.lang.String |
getString(java.lang.String key)
Get a string for the given key from this resource bundle. |
private java.lang.String |
unescape(java.lang.String line)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String FWD_SLASH
private static final java.lang.String UNDERSCORE
private static final java.lang.String PROPS_EXT
private static final java.lang.String whiteSpaceChars
private static final java.lang.String keyValueSeparators
private static final java.lang.String strictKeyValueSeparators
private java.util.LinkedHashMap orderedMap
Constructor Detail |
---|
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 InputStream
java.lang.NullPointerException
- if the InputStream is nullMethod Detail |
---|
public 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 file
java.util.MissingResourceException
- if the file cannot be found
java.lang.NullPointerException
- if baseName is nullpublic java.lang.String getString(java.lang.String key)
key
- the key for the desired string
public java.util.Iterator getKeys()
private java.util.LinkedHashMap getPropsAsOrderedMap(java.io.BufferedReader propsReader) throws java.io.IOException
propsReader
- The reader that contains the properties. This method
closes propsReader upon completion
java.io.IOException
private java.lang.String unescape(java.lang.String line)
private boolean continueLine(java.lang.String line)
private static java.lang.String getPropsFileNamePlusLocale(java.lang.String baseName) throws java.util.MissingResourceException, java.lang.NullPointerException
java.util.MissingResourceException
java.lang.NullPointerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |