public class SimpleMessageCommand extends Object implements MessageCommand
MessageCommand
.Constructor and Description |
---|
SimpleMessageCommand()
Default message command constructor.
|
SimpleMessageCommand(Class<?> type,
Locale locale,
String messageKey,
Object[] parameters)
Default message command constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(ApplicationMessageHandler appMessageHandler)
Adds a message to the application context by evaluating the given information.
|
Locale |
getLocale()
Gets the locale for the message.
|
String |
getMessage(MessageHandler messageHandler)
Gets a message by evaluating the given information.
|
String |
getMessageKey()
Gets the key for the message.
|
Object[] |
getParameters()
Returns the parameters for the message.
|
Class<?> |
getType()
Gets the type for the message.
|
void |
setLocale(Locale locale)
Sets the locale for the message.
|
void |
setMessageKey(String messageKey)
Sets the key for the message.
|
void |
setParameters(Object[] parameters)
Sets the parameters for the message.
|
void |
setType(Object type)
Sets the type for the message.
|
public SimpleMessageCommand()
public SimpleMessageCommand(Class<?> type, Locale locale, String messageKey, Object[] parameters)
type
- Type for the message. Must be annotated with MessageBundle
.locale
- Locale for the message.messageKey
- Key for the message.parameters
- Parameters for the message.public Locale getLocale()
MessageCommand
getLocale
in interface MessageCommand
MessageCommand.getLocale()
public final void setLocale(Locale locale)
MessageCommand
setLocale
in interface MessageCommand
locale
- New locale for the message.MessageCommand.setLocale(java.util.Locale)
public Class<?> getType()
MessageBundle
.public void setType(Object type)
MessageBundle
.setType
in interface MessageCommand
type
- New type for the message.public Object[] getParameters()
public void setParameters(Object[] parameters)
MessageCommand
setParameters
in interface MessageCommand
parameters
- New parameters for the message.MessageCommand.setParameters(java.lang.Object[])
public String getMessageKey()
public void setMessageKey(String messageKey)
MessageCommand
setMessageKey
in interface MessageCommand
messageKey
- New key for the message.MessageCommand.setMessageKey(java.lang.String)
public String getMessage(MessageHandler messageHandler) throws MessageNotFoundException
MessageCommand
getMessage
in interface MessageCommand
messageHandler
- The message handler to be used.MessageNotFoundException
- If the message cannot be found.MessageCommand.getMessage(org.dejava.component.i18n.message.handler.MessageHandler)
public void addMessage(ApplicationMessageHandler appMessageHandler) throws MessageNotFoundException
MessageCommand
addMessage
in interface MessageCommand
appMessageHandler
- The application message handler to be used.MessageNotFoundException
- If the message cannot be found.MessageCommand.addMessage(org.dejava.component.i18n.message.handler.ApplicationMessageHandler)
Copyright © 2013. All Rights Reserved.