Class CCLabelUtilities

java.lang.Object
com.ibm.debug.pdt.codecoverage.core.results.CCLabelUtilities
All Implemented Interfaces:
CCNLConstants

public class CCLabelUtilities extends Object implements CCNLConstants
Utility methods to obtain label text from API labels
Since:
9.0
  • Constructor Details

    • CCLabelUtilities

      public CCLabelUtilities()
  • Method Details

    • setLanguage

      public static void setLanguage(int language)
      Set the default language see CCNLConstants for list
      Parameters:
      language - language id as defined in CCNLConstants
    • setLanguage

      public static void setLanguage(Locale locale)
      Set the default language using locale
      Parameters:
      locale - locale for label text
    • getLabel

      public static String getLabel(String labelKey, String[] parms)
      Retrieves the full label based on key and parameters
      Parameters:
      labelKey - label key
      parms - substitution values
      Returns:
      the label with substitutions
    • getLabel

      public static String getLabel(String labelKey, String[] parms, int language)
      Retrieves the full label based on the key and parameters for the given language
      Parameters:
      labelKey - label key
      parms - substitution values
      language - language id as defined in CCNLConstants
      Returns:
      the label with substitutions
      Since:
      9.0
    • getLabel

      public static String getLabel(String labelKey, String[] parms, Locale locale)
      Retrieves the full label based on the key and parameters for the given locale
      Parameters:
      labelKey - label key
      parms - substitution values
      locale - locale for label text
      Returns:
      the label with substitutions
      Since:
      9.0
    • getLabel

      public static String getLabel(String encodedLabel)
      Retrieve the full label given an encoded label
      Parameters:
      encodedLabel - the label key and parameter string combination or just the label key
      Returns:
      full label in the default language
      Since:
      9.0
    • getLabel

      public static String getLabel(String encodedLabel, int language)
      Retrieve the full label text with substitutions executed Will return the label if it is a plain text (non-encoded) label
      Parameters:
      encodedLabel - the label key and parameter string combination or just the label key
      language - language as defined in CCNLConstants
      Returns:
      full label text in the selected language
      Since:
      9.0
    • getLabel

      public static String getLabel(String encodedLabel, Locale locale)
      Retrieve the full label text with substitutions executed Will return the label if it is a plain text (non-encoded) label
      Parameters:
      encodedLabel - the label key and parameter string combination or just the label key
      locale - locale for label text
      Returns:
      full label text in the selected locale
      Since:
      9.0
    • getLabelId

      public static String getLabelId(String encodedLabel)
      Return the label id or key from the encoded label
      Parameters:
      encodedLabel - the label key and parameter string combination or just the label key
      Returns:
      label id or key or "" if passed label is invalid
    • encodeLabel

      public static String encodeLabel(String labelKey, String[] parms)
      Given a label key and an array of zero or more parameters an encoded string is returned that can be stored into the objects that inherit ICCBase and extend CCAbstractException This format has the advantage that is does not contain translatable text. Some classes like CCAbstractException have helper methods that don't require an array
      Parameters:
      labelKey - label key
      parms - substitution values
      Returns:
      encoded label string
      Since:
      9.0
    • encodeLabel

      public static String encodeLabel(String labelKey, String[] parms, int language)
      Given a label key and an array of zero or more parameters an encoded string is returned that can be stored into the objects that inherit ICCBase and extend CCAbstractException This format has the advantage that is does not contain translatable text. Some classes like CCAbstractException have helper methods that don't require an array
      Parameters:
      labelKey - label key
      parms - substitution values
      language - language of label - used if message only appears in the specified language see CCNLConstants
      Returns:
      encoded label string
      Since:
      9.0
    • encodeLabel

      public static String encodeLabel(String labelKey, String[] parms, Locale locale)
      Given a label key and an array of zero or more parameters an encoded string is returned that can be stored into the objects that inherit ICCBase and extend CCAbstractException This format has the advantage that is does not contain translatable text. Some classes like CCAbstractException have helper methods that don't require an array
      Parameters:
      labelKey - label key
      parms - substitution values
      locale - locale of label - used if message only appears in the specified language
      Returns:
      encoded label string
      Since:
      9.0