1 16 17 package de.schlichtherle.key.passwd.console; 18 19 import java.text.MessageFormat ; 20 import java.util.ResourceBundle ; 21 22 28 class Resources { 29 30 31 public final ResourceBundle bundle; 32 33 public Resources(String baseName) { 34 bundle = ResourceBundle.getBundle(baseName); 35 } 36 37 41 public final String getString(String key) { 42 return bundle.getString(key); 43 } 44 45 50 public final String getString(String key, Object [] arguments) { 51 return MessageFormat.format(getString(key), arguments); 52 } 53 54 59 public final String getString(String key, Object argument) { 60 return MessageFormat.format(getString(key), new Object [] { argument }); 61 } 62 63 68 public final String getString(String key, int argument) { 69 return MessageFormat.format(getString(key), new Object [] { new Integer (argument) }); 70 } 71 } 72 | Popular Tags |