| 1 | |
package uk.ac.ebi.ep.biomart.adapter; |
| 2 | |
|
| 3 | |
import java.text.MessageFormat; |
| 4 | |
import java.util.ResourceBundle; |
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | 0 | public class Transformer { |
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
public static String getMessageTemplate(String tplName, Object[] messageArguments) { |
| 28 | 6 | ResourceBundle messages = ResourceBundle.getBundle("MessageBundle_xml"); |
| 29 | |
|
| 30 | 6 | MessageFormat formatter = new MessageFormat(""); |
| 31 | 6 | formatter.applyPattern(messages.getString(tplName)); |
| 32 | 6 | String message = formatter.format(messageArguments); |
| 33 | 6 | return message; |
| 34 | |
} |
| 35 | |
|
| 36 | |
public static String getMessageTemplate(String tplName) { |
| 37 | 3 | ResourceBundle messages = ResourceBundle.getBundle("MessageBundle_xml"); |
| 38 | 3 | return messages.getString(tplName); |
| 39 | |
} |
| 40 | |
} |