Class CCMessageUtilities
java.lang.Object
com.ibm.debug.pdt.codecoverage.core.results.CCMessageUtilities
- All Implemented Interfaces:
CCNLConstants
Utility methods to obtain message text from API messages
- Since:
- 3.1
-
Field Summary
Fields inherited from interface com.ibm.debug.pdt.codecoverage.core.results.CCNLConstants
BRAZILIAN_PORTUGUESE, CZECH, EMPTYSTRINGS, ENGLISH, FRENCH, GERMAN, HUNGARIAN, ITALIAN, JAPANESE, KOREAN, POLISH, RUSSIAN, SIMPLIFIED_CHINESE, SPANISH, TRADITIONAL_CHINESE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodeMessage(String messageKey, String[] parms) Given a message key and an array of zero or more parameters an encoded string is returned that can be stored into the objects that inheritICCBaseand extendCCAbstractExceptionThis format has the advantage that is does not contain translatable text.static StringencodeMessage(String messageKey, String[] parms, int language) This method will accept a message key + parms or it will accept a string that represents a complete message if an empty or null parm is passedstatic StringencodeMessage(String messageKey, String[] parms, Locale locale) This method will accept a message key + parms or it will accept a string that represents a complete message if an empty or null parm is passedstatic chargetErrorLevel(String encodedMessage) Retrieves the error level of the message Results may be inconsistent if a plain text messages is passedstatic StringgetMessage(String encodedMessage) Retrieve the full message text with substitutions executed Will return the message if it is a plain text (non-encoded) messagestatic StringgetMessage(String encodedMessage, int language) Retrieve the full message text with substitutions executed Will return the message if it is a plain text (non-encoded) messagestatic StringgetMessage(String messageKey, String[] parms) Retrieves the full message based on key and parametersstatic StringgetMessage(String messageKey, String[] parms, int language) Retrieves the full message based on the key and parameters for the given languagestatic StringgetMessage(String messageKey, String[] parms, Locale locale) Retrieves the full message based on the key and parameters for the given languagestatic StringgetMessage(String encodedMessage, Locale locale) Retrieve the full message text with substitutions executed Will return the message if it is a plain text (non-encoded) messagestatic StringgetMessageId(String encodedMessage) Return the message id or key from the encoded messagestatic voidsetLanguage(int language) Set the default language seeCCNLConstantsfor liststatic voidsetLanguage(Locale locale) Set the default language using locale
-
Constructor Details
-
CCMessageUtilities
public CCMessageUtilities()
-
-
Method Details
-
setLanguage
public static void setLanguage(int language) Set the default language seeCCNLConstantsfor list- Parameters:
language- language id as defined inCCNLConstants
-
setLanguage
Set the default language using locale- Parameters:
locale- locale for label text- Since:
- 5.0
-
getMessage
Retrieves the full message based on key and parameters- Parameters:
messageKey- the message keyparms- the list of parameters- Returns:
- the message with substitutions
-
getMessage
Retrieves the full message based on the key and parameters for the given language- Parameters:
messageKey- message key or idparms- substitution valueslanguage- language id as defined inCCNLConstants- Returns:
- full message text
- Since:
- 5.0
-
getMessage
Retrieves the full message based on the key and parameters for the given language- Parameters:
messageKey- message key or idparms- substitution valueslocale- locale for message text- Returns:
- full message text
- Since:
- 5.0
-
getMessage
Retrieve the full message text with substitutions executed Will return the message if it is a plain text (non-encoded) message- Parameters:
encodedMessage- the message key and parameter string combination or just the message key- Returns:
- full message in the default language
- Since:
- 4.0
-
getMessage
Retrieve the full message text with substitutions executed Will return the message if it is a plain text (non-encoded) message- Parameters:
encodedMessage- the message key and parameter string combination or just the message keylanguage- language id as defined inCCNLConstants- Returns:
- the full message text
- Since:
- 5.0
-
getMessage
Retrieve the full message text with substitutions executed Will return the message if it is a plain text (non-encoded) message- Parameters:
encodedMessage- the message key and parameter string combination or just the message keylocale- locale for message text- Returns:
- the full message text
- Since:
- 5.0
-
getMessageId
Return the message id or key from the encoded message- Parameters:
encodedMessage- the message key and parm string combination or just the message key- Returns:
- message id or key or "" if passed message is invalid
-
getErrorLevel
Retrieves the error level of the message Results may be inconsistent if a plain text messages is passed- Parameters:
encodedMessage- the message and parameter string combination- Returns:
- the error level
-
encodeMessage
Given a message key and an array of zero or more parameters an encoded string is returned that can be stored into the objects that inheritICCBaseand extendCCAbstractExceptionThis format has the advantage that is does not contain translatable text. Some classes likeCCAbstractExceptionhave helper methods that don't require an array- Parameters:
messageKey- message key or idparms- substitution values- Returns:
- encoded message string
- Since:
- 4.0
-
encodeMessage
This method will accept a message key + parms or it will accept a string that represents a complete message if an empty or null parm is passed- Parameters:
messageKey- message key or idparms- substitution valueslanguage- language as defined inCCNLConstants- Returns:
- encoded message
- Since:
- 5.0
-
encodeMessage
This method will accept a message key + parms or it will accept a string that represents a complete message if an empty or null parm is passed- Parameters:
messageKey- message key or idparms- substitution valueslocale- local for message text- Returns:
- encoded message
- Since:
- 5.0
-