org.kuali.rice.krad.util
Class MessageUtils

java.lang.Object
  extended by org.kuali.rice.krad.util.MessageUtils

public class MessageUtils
extends Object


Constructor Summary
MessageUtils()
           
 
Method Summary
static Set<String> findFields(String input)
          Returns a Set of all interpolation targets (fields) within a String.
static String interpolate(String message, Map<String,Object> data)
          Interpolates a message based on parameter index, assuming message is formatted using a ${0}..${n} syntax
static String interpolate(String message, String... data)
          Interpolates a message based on values contained in the data map, assuming message is formatted using a ${key} syntax.
static String interpolate(String message, String parameter, Object value)
          Interpolates a message which requires only a single property replacement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageUtils

public MessageUtils()
Method Detail

interpolate

public static String interpolate(String message,
                                 String... data)
Interpolates a message based on values contained in the data map, assuming message is formatted using a ${key} syntax.

Parameters:
message - the message to be interpolated
data - Map containing the data to be used for interpolation
Returns:
the interpolated message

interpolate

public static String interpolate(String message,
                                 Map<String,Object> data)
Interpolates a message based on parameter index, assuming message is formatted using a ${0}..${n} syntax

Parameters:
message - the message to be interpolated
data - varargs to be used for interpolation
Returns:
the interpolated message

interpolate

public static String interpolate(String message,
                                 String parameter,
                                 Object value)
Interpolates a message which requires only a single property replacement.

Parameters:
message -
parameter -
value -
Returns:
the interpolated message

findFields

public static Set<String> findFields(String input)
Returns a Set of all interpolation targets (fields) within a String.

Parameters:
input - the String from which to extract the interpolation targets
Returns:
Set containing the field names of the interpolation targets


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.