IBM Rational Functional Tester
Version 8.2.1
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.services
Class StringTableService

java.lang.Object
  extended by com.rational.test.ft.services.StringTableService

public class StringTableService
extends java.lang.Object

Provides a mechanism for doing lookups on localized string resources. String tables should be named after the project and stored in the resources directory, using the same naming convention as java localized properties files. i.e. in a project named MyProject on an US English machine the list of files searched would be: \MyProject\resources\MyProject_en_US.properties \MyProject\resources\MyProject_en.properties \MyProject\resources\MyProject.properties


Constructor Summary
StringTableService()
           
 
Method Summary
static java.lang.String getString(java.lang.String key)
          Lookup and return the string table entry corresponding to the given key.
static java.lang.String[] getStringTableResourceCandidates(java.util.Locale locale)
          Get the list of resource files to look for based on the locale.
static boolean isLocalizedResourceAvailable()
          Check to see if a localized string table is loaded.
static void setStringTableLocale(java.util.Locale locale)
          Load the string table for the specified Locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTableService

public StringTableService()
Method Detail

getString

public static java.lang.String getString(java.lang.String key)
Lookup and return the string table entry corresponding to the given key. This will load the string table if needed. String tables are loaded using the same rules as Java localized properties files. The files will be searched for in the datastore's resources directory. To load resources for a locale other than the default use setStringTableLocale

Parameters:
key: - the key to look for in the string table properties file.

setStringTableLocale

public static void setStringTableLocale(java.util.Locale locale)
Load the string table for the specified Locale.

Parameters:
locale: - the Locale to load the string table for.

isLocalizedResourceAvailable

public static boolean isLocalizedResourceAvailable()
Check to see if a localized string table is loaded.

Returns:
true if a localized string table is loaded.

getStringTableResourceCandidates

public static java.lang.String[] getStringTableResourceCandidates(java.util.Locale locale)
Get the list of resource files to look for based on the locale. The array is ordered with the first entry being the first to look for, etc.

Parameters:
locale - the locale to get resource files for. If null is passed in the default locale is used.
Returns:
ordered array of resource file full paths.