Package java.util
Class PropertyResourceBundle
java.lang.Object
java.util.ResourceBundle
java.util.PropertyResourceBundle
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).- 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
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 Details
-
PropertyResourceBundle
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
Constructs a new resource bundle with properties read fromreader.- Parameters:
reader- theReader- Throws:
IOException- Since:
- 1.6
-
-
Method Details
-
handleKeySet
- Overrides:
handleKeySetin classResourceBundle
-
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
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.
-