|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.thymeleaf.messageresolver.AbstractMessageResolver
org.thymeleaf.messageresolver.StandardMessageResolver
public class StandardMessageResolver
Standard implementation of IMessageResolver
.
A message in template /WEB-INF/templates/home.html for locale ll_CC-vv ("ll" = language, "CC" = country, "vv" = variant) would be looked for in .properties files in the following sequence:
Constructor Summary | |
---|---|
StandardMessageResolver()
|
Method Summary | |
---|---|
void |
addDefaultMessage(String key,
String value)
Adds a new message to the set of default messages. |
void |
clearDefaultMessages()
Clears the set of default messages. |
java.util.Properties |
getDefaultMessages()
Returns the default messages. |
MessageResolution |
resolveMessage(Arguments arguments,
String key,
Object[] messageParameters)
Resolve the message, returning a MessageResolution object. |
void |
setDefaultMessages(java.util.Properties defaultMessages)
Sets the default messages. |
protected java.util.Properties |
unsafeGetDefaultMessages()
Unsafe method meant only for use by subclasses. |
Methods inherited from class org.thymeleaf.messageresolver.AbstractMessageResolver |
---|
checkInitialized, checkNotInitialized, getName, getOrder, initialize, initializeSpecific, isInitialized, setName, setOrder, unsafeGetName, unsafeGetOrder |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandardMessageResolver()
Method Detail |
---|
public java.util.Properties getDefaultMessages()
Returns the default messages. These messages will be used if no other messages can be found.
protected java.util.Properties unsafeGetDefaultMessages()
Unsafe method meant only for use by subclasses.
public void setDefaultMessages(java.util.Properties defaultMessages)
Sets the default messages. These messages will be used if no other messages can be found.
defaultMessages
- the new default messagespublic void addDefaultMessage(String key, String value)
Adds a new message to the set of default messages.
key
- the message keyvalue
- the message value (text)public void clearDefaultMessages()
Clears the set of default messages.
public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters)
IMessageResolver
Resolve the message, returning a MessageResolution
object.
If the message cannot be resolved, this method should return null.
arguments
- the Arguments
object being used for template processingkey
- the message keymessageParameters
- the (optional) message parameters
MessageResolution
object containing the resolved message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |