org.kuali.rice.krad.messages.providers
Class DatabaseMessageProvider

java.lang.Object
  extended by org.kuali.rice.krad.messages.providers.DatabaseMessageProvider
All Implemented Interfaces:
MessageProvider

public class DatabaseMessageProvider
extends Object
implements MessageProvider

Implementation of MessageProvider that stores messages in a database

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

Constructor Summary
DatabaseMessageProvider()
           
 
Method Summary
 Collection<Message> getAllMessagesForComponent(String namespace, String component, String locale)
          Gets all message objects for the given namespace, component, and locale
 LookupService getLookupService()
           
 Message getMessage(String namespace, String component, String key, String locale)
          Gets the Message object that has the given namespace, component, key, and locale
protected  Collection<Message> getMessageByCriteria(String namespace, String component, String key, String locale)
          Performs a query using the LookupService to retrieve messages that match the given namespace, component, name, and locale.
 void setLookupService(LookupService lookupService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseMessageProvider

public DatabaseMessageProvider()
Method Detail

getMessage

public Message getMessage(String namespace,
                          String component,
                          String key,
                          String locale)
Description copied from interface: MessageProvider
Gets the Message object that has the given namespace, component, key, and locale

Specified by:
getMessage in interface MessageProvider
Parameters:
namespace - namespace code the message belongs to
component - component code the namespace is associated with
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
See Also:
MessageProvider.getMessage(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

getAllMessagesForComponent

public Collection<Message> getAllMessagesForComponent(String namespace,
                                                      String component,
                                                      String locale)
Description copied from interface: MessageProvider
Gets all message objects for the given namespace, component, and locale

Specified by:
getAllMessagesForComponent in interface MessageProvider
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
See Also:
MessageProvider.getAllMessagesForComponent(java.lang.String, java.lang.String, java.lang.String)

getMessageByCriteria

protected Collection<Message> getMessageByCriteria(String namespace,
                                                   String component,
                                                   String key,
                                                   String locale)
Performs a query using the LookupService to retrieve messages that match the given namespace, component, name, and locale. Not parameters maybe empty in which case they will not be added to the criteria

Parameters:
namespace - namespace code to search for
component - component code to search for
key - key of the parameter to find
locale - locale code to search for
Returns:
Collection matching messages or empty collection if not are found

getLookupService

public LookupService getLookupService()

setLookupService

public void setLookupService(LookupService lookupService)


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