]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/bean/faces/BaseFacesBean.java
Continued a bit:
[jcore-utils.git] / src / org / mxchange / jcoreee / bean / faces / BaseFacesBean.java
index 15194e3c9fcbb0bd5dbb87136227b12ced64db14..f9ab2b48df663b268f857f1f8062c11b3d15b65e 100644 (file)
@@ -49,7 +49,17 @@ public abstract class BaseFacesBean extends BaseBean {
         */
        static {
                // Init resource bundle list
-               RESOURCE_BUNDLES = new ArrayList<>(2);
+               RESOURCE_BUNDLES = new ArrayList<>(3);
+       }
+
+       /**
+        * Removes all bundles from web application. Typically you want to invoke
+        * this method in a ServletContextListener implemetation on the
+        * contextDestroyed() method.
+        */
+       public static void removeBundles () {
+               // Clear bundles
+               RESOURCE_BUNDLES.clear();
        }
 
        /**
@@ -99,9 +109,6 @@ public abstract class BaseFacesBean extends BaseBean {
         * @param parameterKey Property key
         * <p>
         * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        * @throws NumberFormatException If no number is given in context parameter
         */
        protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
                // Get context parameter
@@ -118,6 +125,9 @@ public abstract class BaseFacesBean extends BaseBean {
         * @param i18nKey I18n key
         * <p>
         * @return Localized message
+        * <p>
+        * @throws NullPointerException If the parameter is null
+        * @throws IllegalArgumentException If the parameter is empty
         */
        protected String getMessageFromBundle (final String i18nKey) {
                // Validate parameter
@@ -126,7 +136,7 @@ public abstract class BaseFacesBean extends BaseBean {
                        throw new NullPointerException("i18nKey is null"); //NOI18N
                } else if (i18nKey.isEmpty()) {
                        // Is empty
-                       throw new IllegalArgumentException("i18nKey is null"); //NOI18N
+                       throw new IllegalArgumentException("i18nKey is empty"); //NOI18N
                }
 
                // Get current locale