Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-03

oracle.apps.fnd.applcore.messages.model.util
Class Util

java.lang.Object
  extended by oracle.apps.fnd.applcore.messages.model.util.Util

public final class Util
extends java.lang.Object

Messages utilities.


Field Summary
static java.util.List<java.lang.String> EMPTY_LIST
          Static empty list.
static java.lang.String INCIDENT_TOKEN
           
static java.lang.String KEY_DELIMITER
          Delimiter used in storing the message key.
 
Method Summary
static java.lang.String autoLog(MessageVORow pMessage, java.util.Map<java.lang.String,java.lang.Object> pTokens)
          Attempt to auto-log a message.
static java.lang.String autoLog(java.lang.String msgKey, java.util.Map<java.lang.String,java.lang.Object> pTokens)
          Attempt to auto-log a message.
static java.lang.String[] breakApartKey(java.lang.String pMsgKey)
          Break apart a message key, in the format appShortName:::messageName into an array of appShortName and messageName components
static java.lang.String buildDetails(MessageServiceAMImpl pService, java.lang.String pAppShortName, java.lang.String pMessageName, boolean for_resource_bundle)
          Return the message text components, in XML format.
static java.lang.String buildDetails(MessageVORow pMessage)
          Return the message text components, in XML format.
static java.lang.String buildDetails(MessageVORow pMessage, boolean for_resource_bundle)
          Return the message text components, in XML format.
static java.lang.String buildDetails(MessageVORow pMessage, java.lang.String pDetails, java.lang.String pAction)
          Return the message text components, in XML format.
static java.lang.String buildDetails(MessageVORow pMessage, java.lang.String pDetails, java.lang.String pAction, boolean for_resource_bundle)
          Return the message text components, in XML format.
static java.lang.String buildDetails(java.lang.Object key)
          Return the message text components, in XML format.
static java.lang.String buildDetails(java.lang.Object key, boolean for_resource_bundle)
          Return the message text components, in XML format.
static java.lang.String buildEncoded(java.lang.String pAppShortName, java.lang.String pMessageName, java.util.List<java.lang.String> pTokens)
          Returns the Message Text in encoded format.
static java.lang.String createEncoded(MessageEOImpl pMsg)
          Returns the Message Text in encoded format.
static java.lang.String createResourceBundleMessage(MessageEOImpl pMsg)
          Convert messageText (the short message) component to MessageFormat-style message.
static java.lang.String createResourceBundleMessage(MessageVORow pMsg)
          Convert messageText (the short message) component to MessageFormat-style message.
static java.lang.String createResourceBundleMessage(java.lang.String pMsg, oracle.jbo.RowIterator pTokens)
          Convert a message component with named tokens to one with numbered tokens, suitable for use with native java MessageFormat class.
static java.lang.String format(MessageVORow pMessage, java.lang.String pText, java.util.List<TokenValueVORow> pTokens)
          Deprecated. Use format(MessageVORow, String, Map) instead.
static java.lang.String format(MessageVORow pMessage, java.lang.String pText, java.util.Map<java.lang.String,java.lang.Object> pTokens)
          Get a token substituted message component.
static oracle.adf.model.binding.DCErrorMessage formatHTMLDetailMessage(java.lang.Exception e)
          Return a detail message object, contructed from an exception.
static oracle.adf.model.binding.DCErrorMessage formatHTMLDetailMessage(java.lang.String xml)
          Return a detail message object, contructed from an exception.
static java.lang.String formatHTMLMessage(java.lang.Exception e)
          Return the formatted, token-substituted short message text, suitable for use in HTML.
static java.lang.String formatHTMLMessage(java.lang.String xml)
          Return the formatted, token-substituted short message text, suitable for use in HTML.
static java.lang.String formatTextMessage(java.lang.String xml)
          Get a formatted text version of the message.
static java.lang.String getResourceBundleMessageText(java.lang.Object key)
          Gets the resource bundle text of a message.
static java.util.List<java.lang.String> getTokens(java.util.regex.Pattern pPattern, java.lang.String pMessage)
          Extracts the tokens from the string.
static java.util.List<java.lang.String> getTokens(java.lang.String pMessage)
          Extracts the tokens from the string.
static java.util.Map<java.lang.String,java.lang.Object> listToMap(java.util.List<TokenValueVORow> pTokens)
          Convert a list of TokenValueVO rows with token names and values to a Map.
static java.util.List<TokenValueVORow> mapToList(TokenValueVOImpl pToken, java.util.Map<java.lang.String,java.lang.Object> pTokens)
          Convert a Map of token name/value object to a list of TokenValueVO rows.
static java.lang.Object[] untokenize(MessageVORow pMsg, java.util.Map<java.lang.String,java.lang.Object> params)
          Convert token value Map to an array of token values, in order tokens are declared.
static java.lang.Object[] untokenize(java.lang.String pMsgKey, java.util.Map<java.lang.String,java.lang.Object> params)
          Construct array of values for each token in the message, in order tokens are declared.
static java.lang.Object[] untokenize(java.lang.String pMsgKey, java.lang.Object... params)
          Construct array of values for each token in the message, in order tokens are declared.
static java.lang.Object[] untokenize(java.lang.String pApp, java.lang.String pName, java.util.Map<java.lang.String,java.lang.Object> params)
          Construct array of values for each token in the message, in order tokens are declared.
static java.lang.Object[] untokenize(java.lang.String pApp, java.lang.String pName, java.lang.Object... params)
          Convert token value Map to an array of token values, in order tokens are declared.
static boolean validateText(MessageEOImpl pMsg, java.lang.String pText)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_LIST

public static final java.util.List<java.lang.String> EMPTY_LIST
Static empty list.


KEY_DELIMITER

public static final java.lang.String KEY_DELIMITER
Delimiter used in storing the message key. The message key is concatenated with the product short name, using this delimeter.

See Also:
Constant Field Values

INCIDENT_TOKEN

public static final java.lang.String INCIDENT_TOKEN
See Also:
Constant Field Values
Method Detail

autoLog

public static java.lang.String autoLog(MessageVORow pMessage,
                                       java.util.Map<java.lang.String,java.lang.Object> pTokens)
Attempt to auto-log a message.

Parameters:
pMessage - the message to log
pTokens - the tokens to log

autoLog

public static java.lang.String autoLog(java.lang.String msgKey,
                                       java.util.Map<java.lang.String,java.lang.Object> pTokens)
Attempt to auto-log a message.

Parameters:
msgKey - The message key, in the format APP:::MSGNAME
pTokens - The tokens to log

getTokens

public static java.util.List<java.lang.String> getTokens(java.lang.String pMessage)
Extracts the tokens from the string. Tokens are: The ampersand will is not be part of the token name.

Parameters:
pMessage - Message of the token.
Returns:
Return the list of tokens

getTokens

public static java.util.List<java.lang.String> getTokens(java.util.regex.Pattern pPattern,
                                                         java.lang.String pMessage)
Extracts the tokens from the string. Tokens are: The ampersand will is not be part of the token name.

Parameters:
pPattern - Pattern to use for extracting Tokens
pMessage - String containing the tokens to extract
Returns:
Return the list of tokens

listToMap

public static java.util.Map<java.lang.String,java.lang.Object> listToMap(java.util.List<TokenValueVORow> pTokens)
Convert a list of TokenValueVO rows with token names and values to a Map. Token name is the Map key, map value will be an object of appropriate type for the token type: TEXT = java.lang.String NUMBER = java.math.BigDecimal DATE = java.sql.Timestamp

Parameters:
pTokens -
Returns:
Map of token name/value objects

mapToList

public static java.util.List<TokenValueVORow> mapToList(TokenValueVOImpl pToken,
                                                        java.util.Map<java.lang.String,java.lang.Object> pTokens)
Convert a Map of token name/value object to a list of TokenValueVO rows. Objects in the map are expected to match the declared type of the token: TEXT = java.lang.String NUMBER = java.math.BigDecimal DATE = java.sql.Timestamp Note callers are responsible for freeing the list of VORows returned by this method.

Parameters:
pToken - The TokenValueVOImpl class
pTokens - Map of token names/value objects
Returns:
List of TokenValueVO rows, one row for each token/value pair.

format

@Deprecated
public static java.lang.String format(MessageVORow pMessage,
                                                 java.lang.String pText,
                                                 java.util.List<TokenValueVORow> pTokens)
Deprecated. Use format(MessageVORow, String, Map) instead.

Get a token substituted message component.

Parameters:
pMessage - The Message to be formatted
pText - Text to be formatted. Typically this will be one of components of pMessage.
pTokens - List of rows with token name/values to substitute
Returns:
Returns the formatted string.

format

public static java.lang.String format(MessageVORow pMessage,
                                      java.lang.String pText,
                                      java.util.Map<java.lang.String,java.lang.Object> pTokens)
Get a token substituted message component.

Parameters:
pMessage - The Message to be formatted
pText - Text to be formatted. Typically this will be one of components of pMessage.
pTokens - A map of token name-value pairs
Returns:
Returns the formatted string.

buildEncoded

public static java.lang.String buildEncoded(java.lang.String pAppShortName,
                                            java.lang.String pMessageName,
                                            java.util.List<java.lang.String> pTokens)
Returns the Message Text in encoded format. Note that this String will require token replacement. Encoded format is [APP_SHORT_NAME]