/** * Helper method to do the actual work of fetching resources; allows * getResString(S,S) to be deprecated without affecting getResString(S); */ private static String getResStringDefault(String key, String defaultValue) { return getResStringDefault(key, defaultValue, null); }
/** * Gets the resource string for this key. * * If the resource is not found, a warning is logged * * @param key * the key in the resource file * @return the resource string if the key is found; otherwise, return * "[res_key="+key+"]" */ public static String getResString(String key) { return getResStringDefault(key, RES_KEY_PFX + key + "]"); // $NON-NLS-1$ }
/** * Gets the resource string for this key in Locale. * * If the resource is not found, a warning is logged * * @param key * the key in the resource file * @param forcedLocale Force a particular locale * @return the resource string if the key is found; otherwise, return * "[res_key="+key+"]" * @since 2.7 */ public static String getResString(String key, Locale forcedLocale) { return getResStringDefault(key, RES_KEY_PFX + key + "]", // $NON-NLS-1$ forcedLocale); }
/** * Gets the resource string for this key. * * If the resource is not found, a warning is logged * * @param key * the key in the resource file * @param defaultValue - * the default value * * @return the resource string if the key is found; otherwise, return the * default * @deprecated Only intended for use in development; use * getResString(String) normally */ @Deprecated public static String getResString(String key, String defaultValue) { return getResStringDefault(key, defaultValue); }