/** * Resolves from the given base name and locale the {@link ResourceBundle} and get the * {@link String} from the given key and parameters. * * @param baseName * the base name of the resource bundle, a fully qualified class name * @param locale * the locale for the resource bundle * @param key * the properties key * @param defaultValue * the default value * @param parameters * the parameters * @return the {@link String} value from the given key * @throws MissingResourceException * is thrown if the given key is missing */ public static String getString(final String baseName, final Locale locale, final String key, final String defaultValue, final Object... parameters) throws MissingResourceException { Check.get().notEmpty(baseName, "baseName").notNull(locale, "locale"); final ResourceBundle resourceBundle = ResourceBundleResolver.getBundle(baseName, locale); return ResourceBundleExtensions.getString(resourceBundle, key, defaultValue, parameters); }
/** * Resolves from the given base name and locale the {@link ResourceBundle} and get the * {@link String} from the given key and parameters. * * @param baseName * the base name of the resource bundle, a fully qualified class name * @param locale * the locale for the resource bundle * @param key * the properties key * @param defaultValue * the default value * @param parameters * the parameters * @return the {@link String} value from the given key */ public static String getStringQuietly(final String baseName, final Locale locale, final String key, final String defaultValue, final Object... parameters) { Check.get().notEmpty(baseName, "baseName").notNull(locale, "locale"); final ResourceBundle resourceBundle = ResourceBundleResolver.getBundle(baseName, locale); return ResourceBundleExtensions.getStringQuietly(resourceBundle, key, defaultValue, parameters); }