/** An instance bound to a bundle. This method figures out the bundle name * for the class object's package and uses the class' class loader to * find the bundle. Note, the specified class object must not be * <code>null</code>. * @param cls the class object from which to load the resource bundle * @return the helper instance bound to the bundle */ public static I18NHelper getInstance (final Class cls) { ClassLoader classLoader = AccessController.doPrivileged ( new PrivilegedAction<ClassLoader> () { public ClassLoader run () { return cls.getClassLoader(); } } ); String bundle = getPackageName (cls.getName()) + bundleSuffix; return getInstance (bundle, classLoader); }
/** An instance bound to a bundle. This method figures out the bundle name * for the class object's package and uses the class' class loader to * find the bundle. Note, the specified class object must not be * <code>null</code>. * @param cls the class object from which to load the resource bundle * @return the helper instance bound to the bundle */ public static I18NHelper getInstance (final Class cls) { ClassLoader classLoader = AccessController.doPrivileged ( new PrivilegedAction<ClassLoader> () { public ClassLoader run () { return cls.getClassLoader(); } } ); String bundle = getPackageName (cls.getName()) + bundleSuffix; return getInstance (bundle, classLoader); }