com.plumtree.openfoundation.internationalization
Class XPResourceSet

java.lang.Object
  extended bycom.plumtree.openfoundation.internationalization.XPResourceSet
All Implemented Interfaces:
IXPResourceSet

public class XPResourceSet
extends java.lang.Object
implements IXPResourceSet

XPResourceSet class loads a resource file created using the Plumtree Property Bag Schema. The resource files are primarily used to store the localized string messages. The GetString method of this class is overloaded to support placeholder substitution. GetString uses the overloaded FormatString methods of XPFesourceManager for placeholder subsititution. The placeholder can be escaped using '\' character. The escaped placeholder will not be replaced and will appear as it is without the escape character i.e. \''. For e.g., calling FormatMessage("Hello \{0} {0}", "Test") will return "Hello {0} Test".


Method Summary
static IXPResourceSet CreateFileBasedResourceSet(java.lang.String baseName)
          Creates a resourcemanager using the given resource file name.
 java.lang.String GetString(int iStringID)
          Returns the string value associated with the given key.
 java.lang.String GetString(java.lang.String key)
          Returns the string value associated with the given key.
 java.lang.String GetString(java.lang.String key, java.lang.Object argValue0)
          Returns the string associated with the given key and the placeholder {0} replaced with the given argument value.
 java.lang.String GetString(java.lang.String key, java.lang.Object argValue0, java.lang.Object argValue1)
          Returns the string associated with the given key and the placeholders {0} and {1} replaced with the given argument value.
 java.lang.String GetString(java.lang.String key, java.lang.Object argValue0, java.lang.Object argValue1, java.lang.Object argValue2)
          Returns the string associated with the given key and the placeholders {0}, {1} and {2} replaced with the given argument value.
 java.lang.String GetString(java.lang.String key, java.lang.Object argValue0, java.lang.Object argValue1, java.lang.Object argValue2, java.lang.Object argValue3)
          Returns the string associated with the given key and the placeholders {0}, {1}, {2} and {3} replaced with the given argument value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

CreateFileBasedResourceSet

public static IXPResourceSet CreateFileBasedResourceSet(java.lang.String baseName)
Creates a resourcemanager using the given resource file name. The resource file is loaded and the values in this file are stored in the internal hashtable. Filenames containing the string "ErrorCodes" load their resources into a keyed hashtable as name-value pairs, found in the file as value followed by key. Otherwise the resources are loaded into an integer-indexed array.

Parameters:
baseName - String file name
Returns:
An interface using which the strings in the resource file can be accessed

GetString

public java.lang.String GetString(java.lang.String key)
Returns the string value associated with the given key.

Specified by:
GetString in interface IXPResourceSet
Parameters:
key - The key used to lookup the value
Returns:
The string value associated with the given key

GetString

public java.lang.String GetString(int iStringID)
Returns the string value associated with the given key.

Specified by:
GetString in interface IXPResourceSet
Parameters:
iStringID - The key used to lookup the value
Returns:
The string value associated with the given key

GetString

public java.lang.String GetString(java.lang.String key,
                                  java.lang.Object argValue0)
Returns the string associated with the given key and the placeholder {0} replaced with the given argument value.

Specified by:
GetString in interface IXPResourceSet
Parameters:
key - The key used to lookup the value
argValue0 - The argument value for the placeholder {0}
Returns:
The string value associated with the given key and the placeholder {0} replaced with the given argument value.

GetString

public java.lang.String GetString(java.lang.String key,
                                  java.lang.Object argValue0,
                                  java.lang.Object argValue1)
Returns the string associated with the given key and the placeholders {0} and {1} replaced with the given argument value.

Specified by:
GetString in interface IXPResourceSet
Parameters:
key - The key used to lookup the value
argValue0 - The argument value for the placeholder {0}
argValue1 - The argument value for the placeholder {1}
Returns:
The string value associated with the given key and the placeholders {0} and {1} replaced with the given argument value.

GetString

public java.lang.String GetString(java.lang.String key,
                                  java.lang.Object argValue0,
                                  java.lang.Object argValue1,
                                  java.lang.Object argValue2)
Returns the string associated with the given key and the placeholders {0}, {1} and {2} replaced with the given argument value.

Specified by:
GetString in interface IXPResourceSet
Parameters:
key - The key used to lookup the value
argValue0 - The argument value for the placeholder {0}
argValue1 - The argument value for the placeholder {1}
argValue2 - The argument value for the placeholder {2}
Returns:
The string value associated with the given key and the placeholders {0}, {1} and {2} replaced with the given argument value.

GetString

public java.lang.String GetString(java.lang.String key,
                                  java.lang.Object argValue0,
                                  java.lang.Object argValue1,
                                  java.lang.Object argValue2,
                                  java.lang.Object argValue3)
Returns the string associated with the given key and the placeholders {0}, {1}, {2} and {3} replaced with the given argument value.

Specified by:
GetString in interface IXPResourceSet
Parameters:
key - The key used to lookup the value
argValue0 - The argument value for the placeholder {0}
argValue1 - The argument value for the placeholder {1}
argValue2 - The argument value for the placeholder {2}
argValue3 - The argument value for the placeholder {3}
Returns:
The string value associated with the given key and the placeholders {0}, {1}, {2} and {3} replaced with the given argument value.


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.