Class SpringMessageResolver
- Object
-
- org.thymeleaf.messageresolver.AbstractMessageResolver
-
- org.thymeleaf.spring3.messageresolver.SpringMessageResolver
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.MessageSourceAware,org.thymeleaf.messageresolver.IMessageResolver
public class SpringMessageResolver extends org.thymeleaf.messageresolver.AbstractMessageResolver implements org.springframework.context.MessageSourceAwareImplementation of
IMessageResolverthat integrates the standard Spring way of resolving messages into Thymeleaf.Template-based resolution is done by means of using the available Spring-configured
MessageSourceobjects.Origin-based resolution is done in exactly the same way as in
StandardMessageResolver.- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description SpringMessageResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateAbsentMessageRepresentation(org.thymeleaf.context.ITemplateContext context, Class<?> origin, String key, Object[] messageParameters)org.springframework.context.MessageSourcegetMessageSource()Returns the message source (MessageSource) to be used for message resolution.StringresolveMessage(org.thymeleaf.context.ITemplateContext context, Class<?> origin, String key, Object[] messageParameters)voidsetMessageSource(org.springframework.context.MessageSource messageSource)Sets the message source to be used for message resolution
-
-
-
Method Detail
-
getMessageSource
public final org.springframework.context.MessageSource getMessageSource()
Returns the message source (
MessageSource) to be used for message resolution.- Returns:
- the message source
-
setMessageSource
public final void setMessageSource(org.springframework.context.MessageSource messageSource)
Sets the message source to be used for message resolution
- Specified by:
setMessageSourcein interfaceorg.springframework.context.MessageSourceAware- Parameters:
messageSource- the message source
-
resolveMessage
public final String resolveMessage(org.thymeleaf.context.ITemplateContext context, Class<?> origin, String key, Object[] messageParameters)
- Specified by:
resolveMessagein interfaceorg.thymeleaf.messageresolver.IMessageResolver
-
-