com.ibm.di.cdm.core
Class CDMUtils

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

public class CDMUtils
extends java.lang.Object

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


Constructor Summary
CDMUtils()
           
 
Method Summary
static java.lang.String addPrefix(java.lang.String string)
          Adds a CDM prefix to the provided string, if its does not have it.
static java.lang.String escapeString(java.lang.String string)
          Escapes the '.' characters in the provided string placing a '\' before them.
static java.lang.String escapeString(java.lang.String string, java.lang.String separatorChar, char escapeChar)
          Escapes the provided string using the provided parameters.
static java.lang.String getAttributePath(org.w3c.dom.Node attr)
          Returns the full path from the hierarchy's root to the specified node.
static java.lang.String removeEscapeChars(java.lang.String escapedString)
          Removes the '\' escape characters before each '.' in the input string.
static java.lang.String removePrefix(java.lang.String prefixedString)
          Removes any CDM prefix present in the provided string.
static java.lang.String toLowercaseFirstLetter(java.lang.String name)
          Makes the first letter of the provided string lower.
static java.lang.String toUpperCaseFirstLetter(java.lang.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 java.lang.String toUpperCaseFirstLetter(java.lang.String name)
Capitalizes the first letter in the provided string.

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

toLowercaseFirstLetter

public static java.lang.String toLowercaseFirstLetter(java.lang.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 java.lang.String escapeString(java.lang.String string,
                                            java.lang.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 java.lang.String escapeString(java.lang.String string)
Escapes the '.' characters in the provided string placing a '\' before them.

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

removePrefix

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

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

addPrefix

public static java.lang.String addPrefix(java.lang.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 java.lang.String removeEscapeChars(java.lang.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 java.lang.String getAttributePath(org.w3c.dom.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.