@Test public void testInjectText() { assertEquals("resolved text", "A single text parameter is injected 'injectedText'.", UNDER_TEST.getText("inject.single", "Login", "injectedText")); }
@Override public String getText(String key, String defaultText, Object... arguments) { String pattern = bundle.getText(key, null); if (pattern == null) { return defaultText; } MessageFormat messageFormat = new MessageFormat(pattern, bundle.getLocal()); return messageFormat.format(arguments, new StringBuffer(), null).toString(); }
ResourceLocalizer implements Localizer { @Override public String getText(String key, String defaultText, Object... arguments) { String pattern = bundle.getText(key, null); if (pattern == null) { return defaultText; } MessageFormat messageFormat = new MessageFormat(pattern, bundle.getLocal()); return messageFormat.format(arguments, new StringBuffer(), null).toString(); } }
ResourceLocalizer implements Localizer { @Override public String getText(String key, String defaultText, Object... arguments) { String pattern = bundle.getText(key, null); if (pattern == null) { return defaultText; } MessageFormat messageFormat = new MessageFormat(pattern, bundle.getLocal()); return messageFormat.format(arguments, new StringBuffer(), null).toString(); } ResourceLocalizer(LocalizationBundle bundle); }
ResourceLocalizer implements Localizer { @Override public String getText(String key, String defaultText, Object... arguments) { String pattern = bundle.getText(key, null); if (pattern == null) { return defaultText; } MessageFormat messageFormat = new MessageFormat(pattern, bundle.getLocal()); return messageFormat.format(arguments, new StringBuffer(), null).toString(); } ResourceLocalizer(LocalizationBundle bundle); @Override String formatDate(String dateString); @Override String formatDateTime(String dateString); @Override String formatTime(String dateString); @Override String getText(String key, String defaultText, Object... arguments); @Override String formatDuration(String duration); @Override String formatMoney(String amount, String currencyCode); @Override String formatInteger(String integerString); @Override String formatFloat(String numberString, String numberOfDigits); @Override String formatPercentage(String numberString, String numberOfDigits); @Override String formatMinutes(String durationString); }
ResourceLocalizer implements Localizer { @Override public String getText(String key, String defaultText, Object... arguments) { String pattern = bundle.getText(key, null); if (pattern == null) { return defaultText; } MessageFormat messageFormat = new MessageFormat(pattern, bundle.getLocal()); return messageFormat.format(arguments, new StringBuffer(), null).toString(); } ResourceLocalizer(LocalizationBundle bundle); @Override String formatDate(String dateString); @Override String formatDateTime(String dateString); @Override String formatTime(String dateString); @Override String getText(String key, String defaultText, Object... arguments); @Override String formatDuration(String duration); @Override String formatMoney(String amount, String currencyCode); @Override String formatInteger(String integerString); @Override String formatFloat(String numberString, String numberOfDigits); @Override String formatPercentage(String numberString, String numberOfDigits); @Override String formatMinutes(String durationString);  }