/** * Creates the bundle factory. */ public DefaultBundleFactory() { providers = createProviders(); controlMap = new ConcurrentHashMap<>(); moduleBundlesMap = new HashMap<>(); for (BundleSupport support : BundleSupport.getBundles(getClass().getClassLoader())) { if (support.getModuleInfo() != null) { moduleBundlesMap.put(support.getBundleName(), support); moduleBundlesMap.put(support.getClassName(), support); } } }
/** * Gets the bundle from the corresponding module according to the bundle support. * * @param support the bundle support * @param locale the locale * @return the bundle */ protected ResourceBundle getBundle(BundleSupport support, Locale locale) { return support.getModuleInfo().getHook().getBundle(support.getBundleName(), locale); }
@Override protected ResourceBundle getBundle(BundleSupport support, Locale locale) { if (enabled) { StoredBundle.StoredBundleUDK topKey = control.createUDK(support.getBundleName(), locale); return bundleMap.computeIfAbsent(topKey, storedBundleUDK -> { StoredBundle.StoredBundleUDK key = storedBundleUDK;
getValue()); bundles.add(new BundleSupport(info, className, bundleName));