Package com.portal.bas
Class PResourceFactory
java.lang.Object
java.util.ResourceBundle
com.portal.bas.PResourceFactory
PResourceFactory
is a java.util.ResourceBundle
derivitive that finds and gets resources from a JAR file over the Internet.
In previous releases, this function was performed separately because
bundles in remote JAR files could not be found. Its continued use
allows chaining of resource bundles as needed, not just for a locale.- Version:
- 4
- Author:
- Larry Lynch-Freshner
-
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceBundle
getResBundle
(String res) Static factory method to get a resource bundle for the default locale.static ResourceBundle
getResBundle
(String res, Locale loc) Static factory method to get a resource bundle for a specific locale.static ResourceBundle
getResBundle
(ResourceBundle parent, String res) Static factory method to get a resource bundle for the default locale chained to a current bundle.static ResourceBundle
getResBundle
(ResourceBundle parent, String res, Locale loc) Static factory method to get a resource bundle for a locale chained to a current bundle.static void
setCodebase
(URL codebase) Sets the base URL for this VM instance.Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getKeys, getLocale, getObject, getString, getStringArray, handleGetObject, handleKeySet, keySet, setParent
-
Constructor Details
-
PResourceFactory
public PResourceFactory()
-
-
Method Details
-
setCodebase
Sets the base URL for this VM instance.- Parameters:
codebase
- the URL for the new code base
-
getResBundle
Static factory method to get a resource bundle for the default locale.- Parameters:
res
- the resource bundle name- Returns:
- A resource bundle.
- Throws:
MissingResourceException
- thrown if a resource isn't found
-
getResBundle
Static factory method to get a resource bundle for a specific locale.- Parameters:
res
- the resource bundle nameloc
- the locale to get a bundle for- Returns:
- A resource bundle.
- Throws:
MissingResourceException
- thrown if a resource isn't found
-
getResBundle
public static ResourceBundle getResBundle(ResourceBundle parent, String res) throws MissingResourceException Static factory method to get a resource bundle for the default locale chained to a current bundle.- Parameters:
parent
- the parent bundle to chain tores
- the resource bundle name- Returns:
- A resource bundle.
- Throws:
MissingResourceException
- thrown if a resource isn't found
-
getResBundle
public static ResourceBundle getResBundle(ResourceBundle parent, String res, Locale loc) throws MissingResourceException Static factory method to get a resource bundle for a locale chained to a current bundle.- Parameters:
parent
- the parent bundle to chain tores
- the resource bundle nameloc
- the locale to get a bundle for- Returns:
- A resource bundle.
- Throws:
MissingResourceException
- thrown if the resource can't be found
-