/** * If a manager for a package already exists, it will be reused, else a new * StringManager will be created and returned. * * @param packageName The package name * * @return The StringManager for the given package. */ public static final StringManager getManager(String packageName) { return getManager(packageName, Locale.getDefault()); }
/** * The StringManager will be returned for the package in which the class is * located. If a manager for that package already exists, it will be reused, * else a new StringManager will be created and returned. * * @param clazz The class for which to retrieve the StringManager * * @return The StringManager for the given class. */ public static final StringManager getManager(Class<?> clazz) { return getManager(clazz.getPackage().getName()); }
/** * Retrieve the StringManager for a list of Locales. The first StringManager * found will be returned. * * @param packageName The package for which the StringManager is required * @param requestedLocales the list of Locales * * @return the found StringManager or the default StringManager */ public static StringManager getManager(String packageName, Enumeration<Locale> requestedLocales) { while (requestedLocales.hasMoreElements()) { Locale locale = requestedLocales.nextElement(); StringManager result = getManager(packageName, locale); if (result.getLocale().equals(locale)) { return result; } } // Return the default return getManager(packageName); } }