VLab Common 1.2

pl.psnc.vlab.util.i18n
Class ResourceBundleManager

java.lang.Object
  extended by pl.psnc.vlab.util.i18n.ResourceBundleManager

public class ResourceBundleManager
extends java.lang.Object

ResourceBundleManager class - used for formating compound messages.

Author:
Dominik Stoklosa (~osa~)
Email address
osa@man.poznan.pl

Constructor Summary
ResourceBundleManager(java.lang.String bundle)
          Creates a new instance of ResourceBundleManager
ResourceBundleManager(java.lang.String bundle, java.util.Locale locale)
          Creates a new instance of ResourceBundleManager
 
Method Summary
 java.lang.String getFormattedValue(java.lang.String template, java.lang.Object[] messageArguments)
          Get the formatted key
 java.lang.String getValue(java.lang.String key)
          Get the value for the given key for corresponding resource bundle
 java.lang.Boolean hasKey(java.lang.String key)
          Test whether the given key is defined in the current bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBundleManager

public ResourceBundleManager(java.lang.String bundle)
                      throws java.util.MissingResourceException
Creates a new instance of ResourceBundleManager

Parameters:
bundle - resource bundle
Throws:
java.util.MissingResourceException - exception which is thrown when no resource bundle is found

ResourceBundleManager

public ResourceBundleManager(java.lang.String bundle,
                             java.util.Locale locale)
                      throws java.util.MissingResourceException
Creates a new instance of ResourceBundleManager

Parameters:
bundle - resource bundle
locale - current locale
Throws:
java.util.MissingResourceException - exception which is thrown when no resource bundle is found
Method Detail

getFormattedValue

public java.lang.String getFormattedValue(java.lang.String template,
                                          java.lang.Object[] messageArguments)
Get the formatted key

Parameters:
template - message template
messageArguments - message arguments
Returns:
value for the given key

getValue

public java.lang.String getValue(java.lang.String key)
Get the value for the given key for corresponding resource bundle

Parameters:
key - key for the desired string
Returns:
value for the given key

hasKey

public java.lang.Boolean hasKey(java.lang.String key)
Test whether the given key is defined in the current bundle

Parameters:
key - key for the desired string
Returns:
true if key was found, false otherwise

VLab Common 1.2

Copyright 2004 by VLAB Dominik Stoklosa.