org.broadleafcommerce.common.web
Class BroadleafThymeleafMessageResolver

java.lang.Object
  extended by org.thymeleaf.messageresolver.AbstractMessageResolver
      extended by org.broadleafcommerce.common.web.BroadleafThymeleafMessageResolver
All Implemented Interfaces:
org.thymeleaf.messageresolver.IMessageResolver

public class BroadleafThymeleafMessageResolver
extends org.thymeleaf.messageresolver.AbstractMessageResolver

This implementation will check to see if the key matches the known i18n value key. If that is the case, we will attempt to translate the requested field value for the entity/key. If not, we will delegate to other message resolvers.

Author:
Andre Azzolini (apazzolini)

Field Summary
protected static String I18N_VALUE_KEY
           
protected static org.apache.commons.logging.Log LOG
           
protected  TranslationService translationService
           
 
Constructor Summary
BroadleafThymeleafMessageResolver()
           
 
Method Summary
 org.thymeleaf.messageresolver.MessageResolution resolveMessage(org.thymeleaf.Arguments args, String key, Object[] messageParams)
          Resolve a translated value of an object's property.
 
Methods inherited from class org.thymeleaf.messageresolver.AbstractMessageResolver
checkInitialized, checkNotInitialized, getName, getOrder, initialize, initializeSpecific, isInitialized, setName, setOrder, unsafeGetName, unsafeGetOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

I18N_VALUE_KEY

protected static final String I18N_VALUE_KEY
See Also:
Constant Field Values

translationService

protected TranslationService translationService
Constructor Detail

BroadleafThymeleafMessageResolver

public BroadleafThymeleafMessageResolver()
Method Detail

resolveMessage

public org.thymeleaf.messageresolver.MessageResolution resolveMessage(org.thymeleaf.Arguments args,
                                                                      String key,
                                                                      Object[] messageParams)
Resolve a translated value of an object's property.

Parameters:
args -
key -
messageParams -
Returns:
the resolved message


Copyright © 2013. All Rights Reserved.