Package java.util
Class PropertyResourceBundle
- java.lang.Object
-
- java.util.ResourceBundle
-
- java.util.PropertyResourceBundle
-
public class PropertyResourceBundle extends ResourceBundle
PropertyResourceBundleloads resources from anInputStream. All resources are Strings. The resources must be of the formkey=value, one resource per line (see Properties).- Since:
- 1.1
- See Also:
ResourceBundle,Properties
-
-
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
Constructors Constructor Description PropertyResourceBundle(InputStream stream)Constructs a new instance ofPropertyResourceBundleand loads the properties file from the specifiedInputStream.PropertyResourceBundle(Reader reader)Constructs a new resource bundle with properties read fromreader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Enumeration<String>getKeys()Returns the names of the resources contained in thisResourceBundle.ObjecthandleGetObject(String key)Returns the named resource from thisResourceBundle, or null if the resource is not found.protected Set<String>handleKeySet()-
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet, setParent
-
-
-
-
Constructor Detail
-
PropertyResourceBundle
public PropertyResourceBundle(InputStream stream) throws IOException
Constructs a new instance ofPropertyResourceBundleand loads the properties file from the specifiedInputStream.- Parameters:
stream- theInputStream.- Throws:
IOException- if an error occurs during a read operation on theInputStream.
-
PropertyResourceBundle
public PropertyResourceBundle(Reader reader) throws IOException
Constructs a new resource bundle with properties read fromreader.- Parameters:
reader- theReader- Throws:
IOException- Since:
- 1.6
-
-
Method Detail
-
handleKeySet
protected Set<String> handleKeySet()
- Overrides:
handleKeySetin classResourceBundle
-
getKeys
public Enumeration<String> getKeys()
Description copied from class:ResourceBundleReturns the names of the resources contained in thisResourceBundle.- Specified by:
getKeysin classResourceBundle- Returns:
- an
Enumerationof the resource names.
-
handleGetObject
public Object handleGetObject(String key)
Description copied from class:ResourceBundleReturns the named resource from thisResourceBundle, or null if the resource is not found.- Specified by:
handleGetObjectin classResourceBundle- Parameters:
key- the name of the resource.- Returns:
- the resource object.
-
-