コード例 #1
0
  protected Properties getAllProperties(Locale locale) {
    clearCacheIncludingAncestors();
    PropertiesHolder propertiesHolder = getMergedProperties(locale);
    Properties properties = propertiesHolder.getProperties();

    return properties;
  }
コード例 #2
0
 /**
  * Get a PropertiesHolder that contains the actually visible properties for a Locale, after
  * merging all specified resource bundles. Either fetches the holder from the cache or freshly
  * loads it.
  *
  * <p>Only used when caching resource bundle contents forever, i.e. with cacheSeconds < 0.
  * Therefore, merged properties are always cached forever.
  */
 protected PropertiesHolder getMergedPluginProperties(Locale locale) {
   PropertiesHolder mergedHolder = this.cachedMergedPluginProperties.get(locale);
   if (mergedHolder != null) {
     return mergedHolder;
   }
   Properties mergedProps = new Properties();
   mergedHolder = new PropertiesHolder(mergedProps, -1);
   for (String basename : pluginBaseNames) {
     List filenames = calculateAllFilenames(basename, locale);
     for (int j = filenames.size() - 1; j >= 0; j--) {
       String filename = (String) filenames.get(j);
       PropertiesHolder propHolder = getProperties(filename);
       if (propHolder.getProperties() != null) {
         mergedProps.putAll(propHolder.getProperties());
       }
     }
   }
   this.cachedMergedPluginProperties.put(locale, mergedHolder);
   return mergedHolder;
 }