com.ebay.carad.os.vitalsigns.util
Class MessageFormatUtil

java.lang.Object
  extended by com.ebay.carad.os.vitalsigns.util.MessageFormatUtil

public abstract class MessageFormatUtil
extends java.lang.Object

Provides basic MessageFormat utility methods.

Version:
$Id$
Author:
Jeremy Kraybill

Constructor Summary
MessageFormatUtil()
           
 
Method Summary
private static java.lang.String escapeSingleQuotes(java.lang.String inStr)
          Escape single-quotes for MessageFormat.
static java.lang.String format(java.lang.String inStr, java.lang.Object[] params)
          Reformats the passed-in message format-ready string with the passed-in parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFormatUtil

public MessageFormatUtil()
Method Detail

escapeSingleQuotes

private static java.lang.String escapeSingleQuotes(java.lang.String inStr)
Escape single-quotes for MessageFormat. Single quotes get special treatment by MessageFormat, but we almost never want that behavior.

Parameters:
inStr - the string to escape
Returns:
an escaped string

format

public static java.lang.String format(java.lang.String inStr,
                                      java.lang.Object[] params)
Reformats the passed-in message format-ready string with the passed-in parameters. Single quotes in the passed-in string are escaped and therefore ignored by MessageFormat.

Parameters:
inStr - the string to format
params - the parameters to substitute
Returns:
a formatted string


Copyright © 2004-2009. All Rights Reserved.