org.blojsom.util.resources
Interface ResourceManager

All Known Implementing Classes:
ResourceBundleResourceManager

public interface ResourceManager

ResourceManager

Since:
blojsom 2.13
Version:
$Id: ResourceManager.java,v 1.6 2006/01/04 16:59:55 czarneckid Exp $
Author:
David Czarnecki

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(BlojsomConfiguration blojsomConfiguration)
          Initialize the ResourceManager.
 

Method Detail

init

public void init(BlojsomConfiguration blojsomConfiguration)
          throws BlojsomException
Initialize the ResourceManager.

Parameters:
blojsomConfiguration - Blojsom configuration information
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.

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.

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.

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.

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[])

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
Since:
blojsom 2.21