Package com.complexible.common.base

# Class FormattingResourceBundle

java.lang.Object
java.util.ResourceBundle
com.complexible.common.base.FormattingResourceBundle

public final class FormattingResourceBundle extends ResourceBundle

Simple extension to `ResourceBundle` that handles message formatting via `MessageFormat` for values in the resource bundle.

Since:
  2.0
Version:
  2.0
Author:
  Michael Grove

- ## 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
  `FormattingResourceBundle(String theName)`
  Create a new ResourceBundle
  `FormattingResourceBundle(ResourceBundle theResourceBundle)`
  Create a new FormattingResourceBundle

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `get(String theKey, Object... theArgs)`
  Return the string from the `ResourceBundle`, optionally applying the provided args to the message via `String.format(java.lang.String, java.lang.Object...)`.
  `Enumeration<String>`
  `getKeys()`
  `protected Object`
  `handleGetObject(String key)`

  ### Methods inherited from class java.util.ResourceBundle

  `clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, keySet, setParent`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FormattingResourceBundle

    public FormattingResourceBundle(ResourceBundle theResourceBundle)
    Create a new FormattingResourceBundle
    Parameters:
      `theResourceBundle` - the actual bundle

  - ### FormattingResourceBundle

    public FormattingResourceBundle(String theName)
    Create a new ResourceBundle
    Parameters:
      `theName` - the name of the bundle to load

- ## Method Details

  - ### get

    public String get(String theKey, Object... theArgs)
    Return the string from the `ResourceBundle`, optionally applying the provided args to the message via `String.format(java.lang.String, java.lang.Object...)`.
    Parameters:
      `theKey` - the message key
      `theArgs` - the optiona list of args to apply to the message
    Returns:
      the message or null if a value w/ the key does not exist

  - ### handleGetObject

    protected Object handleGetObject(String key)
    Specified by:
      `handleGetObject` in class `ResourceBundle`

  - ### getKeys

    public Enumeration<String> getKeys()
    Specified by:
      `getKeys` in class `ResourceBundle`