org.riotfamily.common.i18n
Class CodeRevealingMessageSource

java.lang.Object
  extended by org.springframework.context.support.MessageSourceSupport
      extended by org.springframework.context.support.DelegatingMessageSource
          extended by org.riotfamily.common.i18n.CodeRevealingMessageSource
All Implemented Interfaces:
HierarchicalMessageSource, MessageSource

public class CodeRevealingMessageSource
extends DelegatingMessageSource

MessageSource that reveals the code(s) used to look-up a message.

Since:
6.4
Author:
Felix Gnass [fgnass at neteye dot de]

Field Summary
 
Fields inherited from class org.springframework.context.support.MessageSourceSupport
logger
 
Constructor Summary
CodeRevealingMessageSource()
           
 
Method Summary
protected  String getContextPath()
           
 String getMessage(MessageSourceResolvable resolvable, Locale locale)
           
 String getMessage(String code, Object[] args, Locale locale)
           
 String getMessage(String code, Object[] args, String defaultMessage, Locale locale)
           
 boolean isRevealCodes()
           
protected  String revealCodes(String message, String... codes)
           
 void setContextPath(String contextPath)
           
 void setDoNotReveal(Set<String> doNotReveal)
           
 void setRevealCodes(boolean revealCodes)
           
protected  boolean shouldBeRevealed(String code)
           
 
Methods inherited from class org.springframework.context.support.DelegatingMessageSource
getParentMessageSource, setParentMessageSource
 
Methods inherited from class org.springframework.context.support.MessageSourceSupport
createMessageFormat, formatMessage, isAlwaysUseMessageFormat, renderDefaultMessage, resolveArguments, setAlwaysUseMessageFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeRevealingMessageSource

public CodeRevealingMessageSource()
Method Detail

setDoNotReveal

public void setDoNotReveal(Set<String> doNotReveal)

setContextPath

public void setContextPath(String contextPath)

getContextPath

protected String getContextPath()

isRevealCodes

public boolean isRevealCodes()

setRevealCodes

public void setRevealCodes(boolean revealCodes)

shouldBeRevealed

protected boolean shouldBeRevealed(String code)

revealCodes

protected String revealCodes(String message,
                             String... codes)

getMessage

public String getMessage(String code,
                         Object[] args,
                         String defaultMessage,
                         Locale locale)
Specified by:
getMessage in interface MessageSource
Overrides:
getMessage in class DelegatingMessageSource

getMessage

public String getMessage(String code,
                         Object[] args,
                         Locale locale)
Specified by:
getMessage in interface MessageSource
Overrides:
getMessage in class DelegatingMessageSource

getMessage

public String getMessage(MessageSourceResolvable resolvable,
                         Locale locale)
Specified by:
getMessage in interface MessageSource
Overrides:
getMessage in class DelegatingMessageSource