Messages.java 547 B

123456789101112131415161718192021
  1. package de.jplag;
  2. import java.util.MissingResourceException;
  3. import java.util.ResourceBundle;
  4. public class Messages {
  5. private static final String BUNDLE_NAME = "de.jplag.messages"; //$NON-NLS-1$
  6. private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
  7. private Messages() {
  8. }
  9. public static String getString(String key) {
  10. try {
  11. return RESOURCE_BUNDLE.getString(key);
  12. } catch (MissingResourceException e) {
  13. return '!' + key + '!';
  14. }
  15. }
  16. }