org.virtualmock.resource
Class ResourceManager

java.lang.Object
  extended byorg.virtualmock.resource.ResourceManager

public class ResourceManager
extends java.lang.Object

Class to manage access to resource files.

Version:
$Revision: 1.1 $
Author:
Chad Woolley

Constructor Summary
ResourceManager(java.lang.String resourceFileName, java.lang.String language, java.lang.String country)
          Constructor which takes resource file name, language, and country.
 
Method Summary
 java.lang.String getString(java.lang.String key)
          Gets a string from the resource file.
 java.lang.String getString(java.lang.String key, java.lang.String argument1)
          Gets a string from the resource file, substituting an argument.
 java.lang.String getString(java.lang.String key, java.lang.String[] arguments)
          Gets a string from the resource file, substituting arguments.
 java.lang.String getString(java.lang.String key, java.lang.String argument1, java.lang.String argument2)
          Gets a string from the resource file, substituting arguments.
 java.lang.String getString(java.lang.String key, java.lang.String argument1, java.lang.String argument2, java.lang.String argument3)
          Gets a string from the resource file, substituting arguments.
 java.lang.String getString(java.lang.String key, java.lang.String argument1, java.lang.String argument2, java.lang.String argument3, java.lang.String argument4)
          Gets a string from the resource file, substituting arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager(java.lang.String resourceFileName,
                       java.lang.String language,
                       java.lang.String country)
Constructor which takes resource file name, language, and country.

Parameters:
resourceFileName - the name of the resource file
language - the language of the locale
country - the country of the locale
Method Detail

getString

public java.lang.String getString(java.lang.String key)
Gets a string from the resource file.

Parameters:
key - the key to look up in the resource file
Returns:
The value that was found
Throws:
java.lang.RuntimeException - if the key isn't in the resource file

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String[] arguments)
Gets a string from the resource file, substituting arguments.

Parameters:
key - the key to look up in the resource file
arguments - the arguments to substitute
Returns:
The value that was found, with arguments substituted

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String argument1,
                                  java.lang.String argument2)
Gets a string from the resource file, substituting arguments.

Parameters:
key - the key to look up in the resource file
argument1 - the first argument to substitute
argument2 - the second argument to substitute
Returns:
The value that was found, with arguments substituted

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String argument1,
                                  java.lang.String argument2,
                                  java.lang.String argument3)
Gets a string from the resource file, substituting arguments.

Parameters:
key - the key to look up in the resource file
argument1 - the first argument to substitute
argument2 - the second argument to substitute
argument3 - the third argument to substitute
Returns:
The value that was found, with arguments substituted

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String argument1,
                                  java.lang.String argument2,
                                  java.lang.String argument3,
                                  java.lang.String argument4)
Gets a string from the resource file, substituting arguments.

Parameters:
key - the key to look up in the resource file
argument1 - the first argument to substitute
argument2 - the second argument to substitute
argument3 - the third argument to substitute
argument4 - the fourth argument to substitute
Returns:
The value that was found, with arguments substituted

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String argument1)
Gets a string from the resource file, substituting an argument.

Parameters:
key - the key to look up in the resource file
argument1 - the single argument to substitute
Returns:
The value that was found, with argument substituted


Copyright © 2003-2005 Virtual Mock. All Rights Reserved.