1 12 package org.eclipse.jdt.internal.junit.runner; 13 14 import java.text.MessageFormat ; 15 import java.util.MissingResourceException ; 16 import java.util.ResourceBundle ; 17 18 public class JUnitMessages { 19 20 private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.junit.runner.JUnitMessages"; 22 private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME); 23 24 private JUnitMessages() { 25 } 26 27 32 public static String getFormattedString(String key, Object arg) { 33 return MessageFormat.format(getString(key), new Object [] { arg }); 34 } 35 36 39 public static String getFormattedString(String key, Object [] args) { 40 return MessageFormat.format(getString(key), args); 41 } 42 43 public static String getString(String key) { 44 try { 45 return RESOURCE_BUNDLE.getString(key); 46 } catch (MissingResourceException e) { 47 return '!' + key + '!'; 48 } 49 } 50 } 51 | Popular Tags |