2 * (c) Copyright IBM Corp. 2000, 2001.
5 package net.sourceforge.phpeclipse.obfuscator;
7 import java.text.MessageFormat;
8 import java.util.MissingResourceException;
9 import java.util.ResourceBundle;
11 public class ObfuscatorMessages {
13 private static final String RESOURCE_BUNDLE = ObfuscatorMessages.class
16 private static ResourceBundle fgResourceBundle = ResourceBundle
17 .getBundle(RESOURCE_BUNDLE);
19 private ObfuscatorMessages() {
22 public static String getString(String key) {
24 return fgResourceBundle.getString(key);
25 } catch (MissingResourceException e) {
26 return '!' + key + '!';
31 * Gets a string from the resource bundle and formats it with the argument
34 * the string used to get the bundle value, must not be null
36 public static String getFormattedString(String key, Object arg) {
37 return MessageFormat.format(getString(key), new Object[] { arg });
41 * Gets a string from the resource bundle and formats it with arguments
43 public static String getFormattedString(String key, Object[] args) {
44 return MessageFormat.format(getString(key), args);