com.ibm.di.server
Class ResourceHash

java.lang.Object
  extended by com.ibm.di.server.ResourceHash

public class ResourceHash
extends Object

Utility class for locating NLS strings. The strings have their special sequences (e.g. "\n", "\t") replaced with corresponding special characters (e.g. new line, tab).


Constructor Summary
ResourceHash(String category)
           
 
Method Summary
static String escapeSpecialChars(String str)
          Replaces special characters such as new lines and tabs with special sequences such as "\n" and "\t".
static String getDocument(String path)
           
static ResourceHash getHash(String category)
           
static URL getResource(String path)
           
 String getString(String resource)
          Return the NLS string given the resource
 String getString(String resource, Object param)
          Return the NLS string given the resource and a parameter
 String getString(String resource, Object[] params)
          Returns the NLS string value for the passed "resource" (key) and replaces the placeholders {0},{1},etc by the corresponding params[0],params[1],etc.
static String substituteSpecialSequences(String str)
          Replaces special sequences with their corresponding special characters: "\n" with a new line, "\t" a with tab, etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHash

public ResourceHash(String category)
Method Detail

getHash

public static ResourceHash getHash(String category)

getDocument

public static String getDocument(String path)

getResource

public static URL getResource(String path)

escapeSpecialChars

public static String escapeSpecialChars(String str)
Replaces special characters such as new lines and tabs with special sequences such as "\n" and "\t". It acts as an opposite of the substituteSpecialSequences method.

Parameters:
str - a string, to work on
Returns:
the string, having its special characters replaced

substituteSpecialSequences

public static String substituteSpecialSequences(String str)
Replaces special sequences with their corresponding special characters: "\n" with a new line, "\t" a with tab, etc. It acts as an opposite of the escapeSpecialChars method.

Parameters:
str - a String, to work on
Returns:
the String, having its special sequences replaced

getString

public String getString(String resource)
Return the NLS string given the resource


getString

public String getString(String resource,
                        Object param)
Return the NLS string given the resource and a parameter


getString

public String getString(String resource,
                        Object[] params)
Returns the NLS string value for the passed "resource" (key) and replaces the placeholders {0},{1},etc by the corresponding params[0],params[1],etc.

Parameters:
resource - The key whole value is to be retrieved.
params - An array of strings which will replace placeholders
Returns:
The value with placeholders replaced.