Class PResourceFactory

java.lang.Object
java.util.ResourceBundle
com.portal.bas.PResourceFactory

public abstract class PResourceFactory extends ResourceBundle
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
  • Constructor Details

    • PResourceFactory

      public PResourceFactory()
  • Method Details

    • setCodebase

      public static void setCodebase(URL codebase)
      Sets the base URL for this VM instance.
      Parameters:
      codebase - the URL for the new code base
    • getResBundle

      public static ResourceBundle getResBundle(String res) throws MissingResourceException
      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

      public static ResourceBundle getResBundle(String res, Locale loc) throws MissingResourceException
      Static factory method to get a resource bundle for a specific locale.
      Parameters:
      res - the resource bundle name
      loc - 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 to
      res - 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 to
      res - the resource bundle name
      loc - the locale to get a bundle for
      Returns:
      A resource bundle.
      Throws:
      MissingResourceException - thrown if the resource can't be found