public class MessageBuilder extends Object
Constructor and Description |
---|
MessageBuilder() |
Modifier and Type | Method and Description |
---|---|
static void |
addMessageIntoList(List<Message> messageList,
Message message)
add the given message into the given message list
|
static String |
buildErrorMessageWithDataDictionary(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass,
String attributeName,
String currentValue)
build the error message with the given label and current value
|
static Message |
buildMessage(String errorMessageKey,
int errorType)
Build the error message with the message body and error type
|
static Message |
buildMessage(String errorMessageKey,
String invalidValue)
Build the message for a fatal error with the message body and invalid value
|
static Message |
buildMessage(String errorMessageKey,
String invalidValue,
int errorType)
Build the error message with the message body, invalid value and error type
|
static Message |
buildMessageWithPlaceHolder(String errorMessageKey,
int errorType,
Object... invalidValues)
Build the error message with the message body, invalid value and error type.
|
static Message |
buildMessageWithPlaceHolder(String errorMessageKey,
Object... invalidValues)
Build the message for a fatal error with the message body and invalid value.
|
static String |
formatMessageBody(String errorMessageBody,
String invalidValue)
Format the error message body based on the given error message and invalid value
|
static String |
getPropertyValueAsString(String messageKey)
get the message from application resource properties with the given key
|
static String |
getShortLabel(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass,
String attributeName)
get the label of the specified attribute of the given business object
|
public MessageBuilder()
public static void addMessageIntoList(List<Message> messageList, Message message)
messageList
- the given message listmessage
- the given messagepublic static Message buildMessage(String errorMessageKey, int errorType)
public static Message buildMessage(String errorMessageKey, String invalidValue)
public static Message buildMessage(String errorMessageKey, String invalidValue, int errorType)
public static String formatMessageBody(String errorMessageBody, String invalidValue)
public static Message buildMessageWithPlaceHolder(String errorMessageKey, int errorType, Object... invalidValues)
public static Message buildMessageWithPlaceHolder(String errorMessageKey, Object... invalidValues)
public static String getPropertyValueAsString(String messageKey)
messageKey
- the given message keypublic static String buildErrorMessageWithDataDictionary(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass, String attributeName, String currentValue)
label
- the given labelcurrentValue
- the given current valuepublic static String getShortLabel(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass, String attributeName)
businessObjectClass
- the given business objectattributeName
- the specified attribute nameCopyright © 2004–2015 The Kuali Foundation. All rights reserved.