public class PropertyResourceBundle extends ResourceBundle
PropertyResourceBundle
loads resources from an InputStream
. All resources are
Strings. The resources must be of the form key=value
, one
resource per line (see Properties).ResourceBundle
,
Properties
ResourceBundle.Control
parent
Constructor and Description |
---|
PropertyResourceBundle(InputStream stream)
Constructs a new instance of
PropertyResourceBundle and loads the
properties file from the specified InputStream . |
PropertyResourceBundle(Reader reader)
Constructs a new resource bundle with properties read from
reader . |
Modifier and Type | Method and Description |
---|---|
Enumeration<String> |
getKeys()
Returns the names of the resources contained in this
ResourceBundle . |
Object |
handleGetObject(String key)
Returns the named resource from this
ResourceBundle , or null if the
resource is not found. |
protected Set<String> |
handleKeySet() |
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet, setParent
public PropertyResourceBundle(InputStream stream) throws IOException
PropertyResourceBundle
and loads the
properties file from the specified InputStream
.stream
- the InputStream
.IOException
- if an error occurs during a read operation on the
InputStream
.public PropertyResourceBundle(Reader reader) throws IOException
reader
.reader
- the Reader
IOException
protected Set<String> handleKeySet()
handleKeySet
in class ResourceBundle
public Enumeration<String> getKeys()
ResourceBundle
ResourceBundle
.getKeys
in class ResourceBundle
Enumeration
of the resource names.public Object handleGetObject(String key)
ResourceBundle
ResourceBundle
, or null if the
resource is not found.handleGetObject
in class ResourceBundle
key
- the name of the resource.