Class WebScriptPropertyResourceBundle
Extends PropertyResourceBundle in order to provide two new capabilities. The first is to
store the path where the properties file used to create the InputStream is located and the second
is to allow additional ResourceBundle properties to be merged into an instance.
The rational of these capabilities is to allow a WebScript to locate and merge extension module
properties files.
- Author:
- David Draper
-
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
ConstructorsConstructorDescriptionWebScriptPropertyResourceBundle(InputStream stream, String resourcePath) Instantiates a newWebScriptPropertyResourceBundle.WebScriptPropertyResourceBundle(ResourceBundle baseBundle, String resourcePath) Constructor for instantiating from an existingResourceBundle. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) Overrides the super class implementation to check the existence of a key across all merged bundlesgetKeys()Overrides the super class implementation to return an enumeration of keys from all the merged bundleshandleGetObject(String key) Overrides the super class implementation to return an object located in the merged bundlesOverrides the super class implementation to return theSetof keys from all merged bundleskeySet()Overrides the super class implementation to return theSetof keys from all merged bundlesvoidmerge(String bundlePath, ResourceBundle resourceBundle) Merges the properties of aResourceBundleinto the currentWebScriptPropertyResourceBundleinstance.Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent
-
Constructor Details
-
WebScriptPropertyResourceBundle
Instantiates a new
WebScriptPropertyResourceBundle.- Parameters:
stream- TheInputStreampassed on to the super class constructor.resourcePath- The location of the properties file used to create theInputStream- Throws:
IOException
-
WebScriptPropertyResourceBundle
Constructor for instantiating from an existing
ResourceBundle. This calls themergemethod to copy the properties from the bundle into theresourcesmap.- Parameters:
baseBundle- ResourceBundleresourcePath- String
-
-
Method Details
-
getResourcePath
- Returns:
- The location of the properties file that was used to instantiate the
WebScriptPropertyResourceBundleinstance.
-
getMergedBundlePaths
- Returns:
- Returns the
StringBuilderinstance containing the paths of all theResourceBundleinstances that have been merged into this instance.
-
merge
Merges the properties of a
ResourceBundleinto the currentWebScriptPropertyResourceBundleinstance. This will override any values mapped to duplicate keys in the current merged properties.- Parameters:
resourceBundle- TheResourceBundleto merge the properties of.
-
handleGetObject
Overrides the super class implementation to return an object located in the merged bundles
- Specified by:
handleGetObjectin classResourceBundle- Returns:
- An
Objectfrom the merged bundles
-
getKeys
Overrides the super class implementation to return an enumeration of keys from all the merged bundles
- Specified by:
getKeysin classResourceBundle- Returns:
- An
Enumerationof the keys across all the merged bundles.
-
handleKeySet
Overrides the super class implementation to return the
Setof keys from all merged bundles- Overrides:
handleKeySetin classResourceBundle- Returns:
- A
Setof keys obtained from all merged bundles
-
containsKey
Overrides the super class implementation to check the existence of a key across all merged bundles
- Overrides:
containsKeyin classResourceBundle- Returns:
trueif the key is present andfalseotherwise.
-
keySet
Overrides the super class implementation to return the
Setof keys from all merged bundles- Overrides:
keySetin classResourceBundle- Returns:
- A
Setof keys obtained from all merged bundles
-