org.kuali.rice.krad.messages
Interface MessageService

All Known Implementing Classes:
MessageServiceImpl

public interface MessageService

Message Service API

Messages given within an application can be externalized to a separate repository. Those messages are then retrieved with use of the message service. The API provides various retrieval methods based on how the message is identified

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static String DEFAULT_COMPONENT_CODE
           
static String DEFAULT_NAMESPACE_CODE
           
 
Method Summary
 Collection<Message> getAllMessagesForComponent(String namespace, String component)
          Gets all message objects for the given namespace and component using the default locale
 Collection<Message> getAllMessagesForComponent(String namespace, String component, String locale)
          Gets all message objects for the given namespace, component, and locale
 Message getMessage(String namespace, String component, String key)
          Gets the Message object that has the given namespace, component, key, and the default system locale
 Message getMessage(String namespace, String component, String key, String locale)
          Gets the Message object that has the given namespace, component, key, and locale
 String getMessageText(String key)
          Gets the text for the message that has the given key within the default namespace, component, and locale (note the defaults are determined by the service implementation)
 String getMessageText(String key, String locale)
          Gets the text for the message that has the given key and locale within the default namespace and component (note the defaults are determined by the service implementation)
 String getMessageText(String namespace, String component, String key)
          Gets the text for the message that has the given namespace, component, key, and the default system locale
 String getMessageText(String namespace, String component, String key, String locale)
          Gets the text for the message that has the given namespace, component, key, and locale
 

Field Detail

DEFAULT_NAMESPACE_CODE

static final String DEFAULT_NAMESPACE_CODE
See Also:
Constant Field Values

DEFAULT_COMPONENT_CODE

static final String DEFAULT_COMPONENT_CODE
See Also:
Constant Field Values
Method Detail

getMessage

Message getMessage(String namespace,
                   String component,
                   String key)
Gets the Message object that has the given namespace, component, key, and the default system locale

Parameters:
namespace - namespace code the message belongs to, if null the default namespace should be used
component - component code the namespace is associated with, if null the default component should be used
key - key that identifies the message within the namespace and component
Returns:
Message matching message object, or null if a message was not found

getMessage

Message getMessage(String namespace,
                   String component,
                   String key,
                   String locale)
Gets the Message object that has the given namespace, component, key, and locale

Parameters:
namespace - namespace code the message belongs to, if null the default namespace should be used
component - component code the namespace is associated with, if null the default component should be used
key - key that identifies the message within the namespace and component
locale - locale code for the message to return
Returns:
Message matching message object, or null if a message was not found

getMessageText

String getMessageText(String namespace,
                      String component,
                      String key)
Gets the text for the message that has the given namespace, component, key, and the default system locale

Parameters:
namespace - namespace code the message belongs to, if null the default namespace should be used
component - component code the namespace is associated with, if null the default component should be used
key - key that identifies the message within the namespace and component
Returns:
String text for the matched message, or null if no message was found

getMessageText

String getMessageText(String namespace,
                      String component,
                      String key,
                      String locale)
Gets the text for the message that has the given namespace, component, key, and locale

Parameters:
namespace - namespace code the message belongs to, if null the default namespace should be used
component - component code the namespace is associated with, if null the default component should be used
key - key that identifies the message within the namespace and component
locale - locale code for the message to return
Returns:
String text for the matched message, or null if no message was found

getMessageText

String getMessageText(String key)
Gets the text for the message that has the given key within the default namespace, component, and locale (note the defaults are determined by the service implementation)

Parameters:
key - key that identifies the message within the default namespace and component
Returns:
String text for the matched message, or null if no message was found

getMessageText

String getMessageText(String key,
                      String locale)
Gets the text for the message that has the given key and locale within the default namespace and component (note the defaults are determined by the service implementation)

Parameters:
key - key that identifies the message within the default namespace and component
locale - locale code for the message to return
Returns:
String text for the matched message, or null if no message was found

getAllMessagesForComponent

Collection<Message> getAllMessagesForComponent(String namespace,
                                               String component)
Gets all message objects for the given namespace and component using the default locale

Parameters:
namespace - namespace code the message belongs to
component - component code the namespace is associated with
Returns:
Collection collection of messages that match, or empty collection if no messages are found

getAllMessagesForComponent

Collection<Message> getAllMessagesForComponent(String namespace,
                                               String component,
                                               String locale)
Gets all message objects for the given namespace, component, and locale

Parameters:
namespace - namespace code the message belongs to
component - component code the namespace is associated with
locale - locale code for the message to return
Returns:
Collection collection of messages that match, or empty collection if no messages are found


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.