org.thymeleaf.spring3.messageresolver
Class SpringMessageResolver

Object
  extended by org.thymeleaf.messageresolver.AbstractMessageResolver
      extended by org.thymeleaf.spring3.messageresolver.SpringMessageResolver
All Implemented Interfaces:
org.springframework.context.MessageSourceAware, org.thymeleaf.messageresolver.IMessageResolver

public final 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.

This resolution is done by means of using the available Spring-configured MessageSource objects.

This message resolver will consider you are using a non-reloadable ResourceBundleMessageSource in your Spring configuration and thus will be considered Cacheable

Since:
1.0
Author:
Daniel Fernández

Constructor Summary
SpringMessageResolver()
           
 
Method Summary
 org.springframework.context.MessageSource getMessageSource()
           Returns the message source (MessageSource) to be used for message resolution.
protected  void initializeSpecific()
           
protected  void initializeSpringSpecific()
           
 org.thymeleaf.messageresolver.MessageResolution resolveMessage(org.thymeleaf.Arguments arguments, String key, Object[] messageParameters)
           
 void setMessageSource(org.springframework.context.MessageSource messageSource)
           Sets the message source to be used for message resolution
protected  org.springframework.context.MessageSource unsafeGetMessageSource()
           Uninitialized method meant for use by subclasses.
 
Methods inherited from class org.thymeleaf.messageresolver.AbstractMessageResolver
checkInitialized, checkNotInitialized, getName, getOrder, initialize, isInitialized, setName, setOrder, unsafeGetName, unsafeGetOrder
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringMessageResolver

public SpringMessageResolver()
Method Detail

initializeSpecific

protected final void initializeSpecific()
Overrides:
initializeSpecific in class org.thymeleaf.messageresolver.AbstractMessageResolver

initializeSpringSpecific

protected void initializeSpringSpecific()

getMessageSource

public final org.springframework.context.MessageSource getMessageSource()

Returns the message source (MessageSource) to be used for message resolution.

Returns:
the message source

unsafeGetMessageSource

protected final org.springframework.context.MessageSource unsafeGetMessageSource()

Uninitialized method meant for use by subclasses.

Returns:
the message source

setMessageSource

public void setMessageSource(org.springframework.context.MessageSource messageSource)

Sets the message source to be used for message resolution

Specified by:
setMessageSource in interface org.springframework.context.MessageSourceAware
Parameters:
messageSource - the message source

resolveMessage

public org.thymeleaf.messageresolver.MessageResolution resolveMessage(org.thymeleaf.Arguments arguments,
                                                                      String key,
                                                                      Object[] messageParameters)
Specified by:
resolveMessage in interface org.thymeleaf.messageresolver.IMessageResolver


Copyright © 2012 The THYMELEAF team. All Rights Reserved.