aboutsummaryrefslogtreecommitdiff
path: root/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java')
-rw-r--r--moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java b/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java
index 1edad95..a5c7ecc 100644
--- a/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java
+++ b/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java
@@ -21,7 +21,6 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moaspss.util;
import java.util.ArrayList;
@@ -32,7 +31,7 @@ import java.util.ResourceBundle;
/**
* A class to chain <code>ResourceBundle</code>s.
- *
+ *
* @author Patrick Peck
* @version $Id$
*/
@@ -40,11 +39,11 @@ public class ResourceBundleChain {
/** Error message indicating the resource is not available. */
private static final String ERROR_MISSING_RESOURCE = "Missing resource";
/** The <code>ResourceBundle</code>s contained in this chain. */
- private List resourceBundles = new ArrayList();
+ private final List resourceBundles = new ArrayList();
/**
* Add a <code>ResourceBundle</code> to the chain.
- *
+ *
* @param resourceBundle The <code>ResourceBundle</code> to add.
*/
public void addResourceBundle(ResourceBundle resourceBundle) {
@@ -53,13 +52,13 @@ public class ResourceBundleChain {
/**
* Return the value of the resource.
- *
+ *
* @param key The key to access the <code>String</code> resource.
* @return The resource value. All the registered <code>ResourceBundle</code>s
- * are searched in the order in which they have previously been added to this
- * <code>ResourceBundleChain</code>.
+ * are searched in the order in which they have previously been added to
+ * this <code>ResourceBundleChain</code>.
* @throws MissingResourceException The resource coult not be found in any of
- * the bundles.
+ * the bundles.
*/
public String getString(String key) throws MissingResourceException {
MissingResourceException lastException = null;
@@ -68,19 +67,19 @@ public class ResourceBundleChain {
// handle case where no resource bundles have been added
if (resourceBundles.size() == 0) {
throw new MissingResourceException(
- ERROR_MISSING_RESOURCE,
- this.getClass().getName(),
- key);
+ ERROR_MISSING_RESOURCE,
+ this.getClass().getName(),
+ key);
}
// try to find the resource in one of the bundles; if it cannot be found,
// return the exception thrown by the last bundle in the list
for (iter = resourceBundles.iterator(); iter.hasNext();) {
- ResourceBundle resourceBundle = (ResourceBundle) iter.next();
+ final ResourceBundle resourceBundle = (ResourceBundle) iter.next();
try {
- String value = resourceBundle.getString(key);
+ final String value = resourceBundle.getString(key);
return value;
- } catch (MissingResourceException e) {
+ } catch (final MissingResourceException e) {
lastException = e;
}
}