Class ReloadableResourceBundleMessagesSource

java.lang.Object
org.springframework.context.support.MessageSourceSupport
org.springframework.context.support.AbstractMessageSource
org.springframework.context.support.AbstractResourceBasedMessageSource
org.springframework.context.support.ReloadableResourceBundleMessageSource
net.solarnetwork.web.support.ReloadableResourceBundleMessagesSource
All Implemented Interfaces:
MessagesSource, org.springframework.beans.factory.Aware, org.springframework.context.HierarchicalMessageSource, org.springframework.context.MessageSource, org.springframework.context.ResourceLoaderAware
Direct Known Subclasses:
PatternMatchingResourceBundleMessagesSource

public class ReloadableResourceBundleMessagesSource extends org.springframework.context.support.ReloadableResourceBundleMessageSource implements org.springframework.context.MessageSource, MessagesSource
Extension of ReloadableResourceBundleMessagesSource to allow finding all keys for all messages.

Adapted from magoffin.matt.xweb.util.ResourceBundleMessagesSource.

Version:
1.0
Author:
matt
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.context.support.ReloadableResourceBundleMessageSource

    org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder
  • Field Summary

    Fields inherited from class org.springframework.context.support.MessageSourceSupport

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getKeys(Locale locale)
    Get an enumeration of keys.
    protected String
    getMessageInternal(String code, Object[] args, Locale locale)
     
     
    void
    Register an additional message resource at runtime.
    void
    setBasenames(String... basenames)
     
    void
     

    Methods inherited from class org.springframework.context.support.ReloadableResourceBundleMessageSource

    calculateAllFilenames, calculateFilenamesForLocale, clearCache, clearCacheIncludingAncestors, getMergedProperties, getProperties, loadProperties, newProperties, refreshProperties, resolveCode, resolveCodeWithoutArguments, setConcurrentRefresh, setFileEncodings, setPropertiesPersister, setResourceLoader, toString

    Methods inherited from class org.springframework.context.support.AbstractResourceBasedMessageSource

    addBasenames, getBasenameSet, getCacheMillis, getDefaultEncoding, isFallbackToSystemLocale, setBasename, setCacheMillis, setCacheSeconds, setDefaultEncoding, setFallbackToSystemLocale

    Methods inherited from class org.springframework.context.support.AbstractMessageSource

    getCommonMessages, getDefaultMessage, getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getParentMessageSource, isUseCodeAsDefaultMessage, resolveArguments, setCommonMessages, setParentMessageSource, setUseCodeAsDefaultMessage

    Methods inherited from class org.springframework.context.support.MessageSourceSupport

    createMessageFormat, formatMessage, isAlwaysUseMessageFormat, renderDefaultMessage, setAlwaysUseMessageFormat

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.context.MessageSource

    getMessage, getMessage, getMessage
  • Constructor Details

    • ReloadableResourceBundleMessagesSource

      public ReloadableResourceBundleMessagesSource()
  • Method Details

    • setBasenames

      public void setBasenames(String... basenames)
      Overrides:
      setBasenames in class org.springframework.context.support.AbstractResourceBasedMessageSource
    • registerMessageResource

      public void registerMessageResource(String resource)
      Description copied from interface: MessagesSource
      Register an additional message resource at runtime.
      Specified by:
      registerMessageResource in interface MessagesSource
      Parameters:
      resource - the resource path to register
    • getKeys

      public Enumeration<String> getKeys(Locale locale)
      Description copied from interface: MessagesSource
      Get an enumeration of keys.
      Specified by:
      getKeys in interface MessagesSource
      Parameters:
      locale - the desired locale
      Returns:
      enumeration of message keys
    • getMessageInternal

      protected String getMessageInternal(String code, Object[] args, Locale locale)
      Overrides:
      getMessageInternal in class org.springframework.context.support.AbstractMessageSource
    • getParent

      public MessagesSource getParent()
      Returns:
      the parent
    • setParent

      public void setParent(MessagesSource parent)
      Parameters:
      parent - the parent to set