Version 2.0.0: update sources
[jvcard.git] / src / com / googlecode / lanterna / bundle / BundleLocator.java
diff --git a/src/com/googlecode/lanterna/bundle/BundleLocator.java b/src/com/googlecode/lanterna/bundle/BundleLocator.java
deleted file mode 100644 (file)
index 9df44de..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.googlecode.lanterna.bundle;
-
-import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-/**
- * This class permits to deal easily with bundles.
- * @author silveryocha
- */
-public abstract class BundleLocator {
-
-    private final String bundleName;
-    private static final ClassLoader loader = BundleLocator.class.getClassLoader();
-
-    /**
-     * Hidden constructor.
-     * @param bundleName the name of the bundle.
-     */
-    protected BundleLocator(final String bundleName) {
-        this.bundleName = bundleName;
-    }
-
-    /**
-     * Method that centralizes the way to get the value associated to a bundle key.
-     * @param locale the locale.
-     * @param key the key searched for.
-     * @param parameters the parameters to apply to the value associated to the key.
-     * @return the formatted value associated to the given key. Empty string if no value exists for
-     * the given key.
-     */
-    protected String getBundleKeyValue(Locale locale, String key, Object... parameters) {
-        String value = null;
-        try {
-            value = getBundle(locale).getString(key);
-        } catch (Exception ignore) {
-        }
-        return value != null ? MessageFormat.format(value, parameters) : null;
-    }
-
-    /**
-     * Gets the right bundle.<br/>
-     * A cache is handled as well as the concurrent accesses.
-     * @param locale the locale.
-     * @return the instance of the bundle.
-     */
-    private ResourceBundle getBundle(Locale locale) {
-        return ResourceBundle.getBundle(bundleName, locale, loader);
-    }
-}