com.ibm.di.cdm.core
Class CDMUtils

java.lang.Object
  extended by com.ibm.di.cdm.core.CDMUtils

public class CDMUtils
extends Object

This class contains several utility methods used by the CDM Components.


Constructor Summary
CDMUtils()
           
 
Method Summary
static String addPrefix(String string)
          Adds a CDM prefix to the provided string, if its does not have it.
static String escapeString(String string)
          Escapes the '.' characters in the provided string placing a '\' before them.
static String escapeString(String string, String separatorChar, char escapeChar)
          Escapes the provided string using the provided parameters.
static String getAttributePath(Node attr)
          Returns the full path from the hierarchy's root to the specified node.
static String removeEscapeChars(String escapedString)
          Removes the '\' escape characters before each '.' in the input string.
static String removePrefix(String prefixedString)
          Removes any CDM prefix present in the provided string.
static String toLowercaseFirstLetter(String name)
          Makes the first letter of the provided string lower.
static String toUpperCaseFirstLetter(String name)
          Capitalizes the first letter in the provided string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDMUtils

public CDMUtils()
Method Detail

toUpperCaseFirstLetter

public static String toUpperCaseFirstLetter(String name)
Capitalizes the first letter in the provided string.

Parameters:
name - input string.
Returns:
the resulting capitalized string.

toLowercaseFirstLetter

public static String toLowercaseFirstLetter(String name)
Makes the first letter of the provided string lower.

Parameters:
name - input string.
Returns:
the input string with lower case first letter.

escapeString

public static String escapeString(String string,
                                  String separatorChar,
                                  char escapeChar)
Escapes the provided string using the provided parameters.

Parameters:
string - input string.
separatorChar - the separator char which must be escaped.
escapeChar - the char used for escaping.
Returns:
the resulting string.

escapeString

public static String escapeString(String string)
Escapes the '.' characters in the provided string placing a '\' before them.

Parameters:
string - input string.
Returns:
resulting string.

removePrefix

public static String removePrefix(String prefixedString)
Removes any CDM prefix present in the provided string.

Parameters:
prefixedString - input string.
Returns:
the resulting string.

addPrefix

public static String addPrefix(String string)
Adds a CDM prefix to the provided string, if its does not have it.

Parameters:
string - input string.
Returns:
the resulting string.

removeEscapeChars

public static String removeEscapeChars(String escapedString)
Removes the '\' escape characters before each '.' in the input string.

Parameters:
escapedString - the escaped input string.
Returns:
the resulting string.

getAttributePath

public static String getAttributePath(Node attr)
Returns the full path from the hierarchy's root to the specified node. The '.' char is used for separating each node name from.

Parameters:
attr - the node which path we want.
Returns:
the full path from the root.