public class SpringMessageResolver
extends org.thymeleaf.messageresolver.AbstractMessageResolver
implements org.springframework.context.MessageSourceAware
Implementation of IMessageResolver
that
integrates the standard Spring way of resolving messages into Thymeleaf.
Template-based resolution is done by means of using the available Spring-configured
MessageSource
objects.
Origin-based resolution is done in exactly the same way as in StandardMessageResolver
.
Constructor and Description |
---|
SpringMessageResolver() |
Modifier and Type | Method and Description |
---|---|
String |
createAbsentMessageRepresentation(org.thymeleaf.context.ITemplateContext context,
Class<?> origin,
String key,
Object[] messageParameters) |
org.springframework.context.MessageSource |
getMessageSource()
Returns the message source (
MessageSource ) to be
used for message resolution. |
String |
resolveMessage(org.thymeleaf.context.ITemplateContext context,
Class<?> origin,
String key,
Object[] messageParameters) |
void |
setMessageSource(org.springframework.context.MessageSource messageSource)
Sets the message source to be used for message resolution
|
public final org.springframework.context.MessageSource getMessageSource()
Returns the message source (MessageSource
) to be
used for message resolution.
public final void setMessageSource(org.springframework.context.MessageSource messageSource)
Sets the message source to be used for message resolution
setMessageSource
in interface org.springframework.context.MessageSourceAware
messageSource
- the message sourcepublic final String resolveMessage(org.thymeleaf.context.ITemplateContext context, Class<?> origin, String key, Object[] messageParameters)
resolveMessage
in interface org.thymeleaf.messageresolver.IMessageResolver
Copyright © 2016 The THYMELEAF team. All rights reserved.