Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.blojsom.util.resources
Class ResourceBundleResourceManager

    java.lang.Object
      org.blojsom.util.resources.ResourceBundleResourceManager

All Implemented Interfaces:
  ResourceManager

public class ResourceBundleResourceManager
extends java.lang.Object
implements ResourceManager

ResourceBundleResourceManager

Since:
  blojsom 3.0
Version:
  $Id: ResourceBundleResourceManager.java,v 1.2 2006/03/21 03:11:09 czarneckid Exp $
Author:
  David Czarnecki

Constructor Summary
`ResourceBundleResourceManager()` Default constructor;

Method Summary
`java.lang.String` | `format(java.lang.String pattern, java.lang.Object[] arguments)` Wrapper for `MessageFormat.format(String, Object[])`
`java.lang.String` | `getString(java.lang.String resourceID, java.lang.String resource, java.lang.String fallback)` Retrieve a string from a given resource bundle for the default locale.
`java.lang.String` | `getString(java.lang.String resourceID, java.lang.String resource, java.lang.String fallback, java.util.Locale locale)` Retrieve a string from a given resource bundle for the particular language and country locale.
`java.lang.String` | `getString(java.lang.String resourceID, java.lang.String resource, java.lang.String fallback, java.lang.String language)` Retrieve a string from a given resource bundle for the particular language and country locale.
`java.lang.String` | `getString(java.lang.String resourceID, java.lang.String resource, java.lang.String fallback, java.lang.String language, java.lang.String country)` Retrieve a string from a given resource bundle for the particular language and country locale.
`void` | `init()` Initialize the resource bundle manager.
`void` | `setResourceBundlesToLoad(java.lang.String[] resourceBundles)` Set the list of resource bundles to load

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ResourceBundleResourceManager

    public ResourceBundleResourceManager()

  Default constructor;

Method Detail

### setResourceBundlesToLoad

    public void setResourceBundlesToLoad(java.lang.String[] resourceBundles)

  Set the list of resource bundles to load

  Parameters:
    `resourceBundles` - List of resource bundles

### init

    public void init()
              throws BlojsomException

  Initialize the resource bundle manager.

  Resource bundles to pre-load are specified in a comma-separated list under the key `blojsom-resource-manager-bundles`.

  Specified by:
    `init` in interface `ResourceManager`
  Throws:
    `BlojsomException`

### getString

    public java.lang.String getString(java.lang.String resourceID,
                                      java.lang.String resource,
                                      java.lang.String fallback)

  Retrieve a string from a given resource bundle for the default locale.

  Specified by:
    `getString` in interface `ResourceManager`
  Parameters:
    `resourceID` - Resource ID to retrieve from the resource bundle
    `resource` - Full-qualified resource bundle from which to retrieve the resource ID
    `fallback` - Fallback string to use if the given resource ID cannot be found
  Returns:
    `resourceID` from resource bundle `resource` or `fallback` if the given resource ID cannot be found

### getString

    public java.lang.String getString(java.lang.String resourceID,
                                      java.lang.String resource,
                                      java.lang.String fallback,
                                      java.lang.String language)

  Retrieve a string from a given resource bundle for the particular language and country locale.

  Specified by:
    `getString` in interface `ResourceManager`
  Parameters:
    `resourceID` - Resource ID to retrieve from the resource bundle
    `resource` - Full-qualified resource bundle from which to retrieve the resource ID
    `fallback` - Fallback string to use if the given resource ID cannot be found
    `language` - Language code
  Returns:
    `resourceID` from resource bundle `resource` or `fallback` if the given resource ID cannot be found

### getString

    public java.lang.String getString(java.lang.String resourceID,
                                      java.lang.String resource,
                                      java.lang.String fallback,
                                      java.lang.String language,
                                      java.lang.String country)

  Retrieve a string from a given resource bundle for the particular language and country locale.

  Specified by:
    `getString` in interface `ResourceManager`
  Parameters:
    `resourceID` - Resource ID to retrieve from the resource bundle
    `resource` - Full-qualified resource bundle from which to retrieve the resource ID
    `fallback` - Fallback string to use if the given resource ID cannot be found
    `language` - Language code
    `country` - Country code
  Returns:
    `resourceID` from resource bundle `resource` or `fallback` if the given resource ID cannot be found

### getString

    public java.lang.String getString(java.lang.String resourceID,
                                      java.lang.String resource,
                                      java.lang.String fallback,
                                      java.util.Locale locale)

  Retrieve a string from a given resource bundle for the particular language and country locale.

  Specified by:
    `getString` in interface `ResourceManager`
  Parameters:
    `resourceID` - Resource ID to retrieve from the resource bundle
    `resource` - Full-qualified resource bundle from which to retrieve the resource ID
    `fallback` - Fallback string to use if the given resource ID cannot be found
    `locale` - Locale object to use when retrieving the resource bundle
  Returns:
    `resourceID` from resource bundle `resource` or `fallback` if the given resource ID cannot be found

### format

    public java.lang.String format(java.lang.String pattern,
                                   java.lang.Object[] arguments)

  Wrapper for `MessageFormat.format(String, Object[])`

  Specified by:
    `format` in interface `ResourceManager`
  Parameters:
    `pattern` - Pattern
    `arguments` - Arguments to apply to pattern
  Returns:
    String where `MessageFormat.format(String, Object[])` has been applied or `null` if there is an error applying the arguments to the pattern

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD