Class ClasspathAwareMessageSource

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.HierarchicalMessageSource, org.springframework.context.MessageSource, org.springframework.context.ResourceLoaderAware

    public class ClasspathAwareMessageSource
    extends org.springframework.context.support.ReloadableResourceBundleMessageSource
    MessageSource which can be aware of OCC extensions and extract messages bundles from them.
    • Nested Class Summary

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

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

      Fields 
      Modifier and Type Field Description
      protected org.springframework.core.io.ContextResource baseOccExtensionDir  
      protected static java.util.function.Function<org.springframework.core.io.ContextResource,​java.lang.String> classpathResourceMapper  
      protected static java.util.function.Predicate<java.lang.String> FILE_FILTER  
      protected org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver  
      • Fields inherited from class org.springframework.context.support.MessageSourceSupport

        logger
    • Constructor Summary

      Constructors 
      Constructor Description
      ClasspathAwareMessageSource​(org.springframework.core.io.ContextResource baseOccExtensionDir)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.springframework.core.io.ContextResource getBaseOccExtensionDir()  
      protected java.util.Set<java.lang.String> getMessagesSet()  
      protected java.lang.String mapToMessageBundleFilePath​(org.springframework.core.io.Resource resource)  
      protected java.lang.String mapToMessageBundlePath​(java.lang.String filePath)  
      void setupMessages()  
      protected boolean validateFilename​(java.lang.String path)  
      • 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, getDefaultLocale, isFallbackToSystemLocale, setBasename, setBasenames, setCacheMillis, setCacheSeconds, setDefaultEncoding, setDefaultLocale, setFallbackToSystemLocale
      • Methods inherited from class org.springframework.context.support.AbstractMessageSource

        getCommonMessages, getDefaultMessage, getDefaultMessage, getMessage, getMessage, getMessage, getMessageFromParent, getMessageInternal, 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
    • Field Detail

      • FILE_FILTER

        protected static final java.util.function.Predicate<java.lang.String> FILE_FILTER
      • classpathResourceMapper

        protected static final java.util.function.Function<org.springframework.core.io.ContextResource,​java.lang.String> classpathResourceMapper
      • baseOccExtensionDir

        protected final org.springframework.core.io.ContextResource baseOccExtensionDir
      • resolver

        protected final org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver
    • Constructor Detail

      • ClasspathAwareMessageSource

        public ClasspathAwareMessageSource​(org.springframework.core.io.ContextResource baseOccExtensionDir)
    • Method Detail

      • setupMessages

        @PostConstruct
        public void setupMessages()
      • getMessagesSet

        protected java.util.Set<java.lang.String> getMessagesSet()
      • mapToMessageBundleFilePath

        protected java.lang.String mapToMessageBundleFilePath​(org.springframework.core.io.Resource resource)
      • validateFilename

        protected boolean validateFilename​(java.lang.String path)
      • mapToMessageBundlePath

        protected java.lang.String mapToMessageBundlePath​(java.lang.String filePath)
      • getBaseOccExtensionDir

        protected org.springframework.core.io.ContextResource getBaseOccExtensionDir()