1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.dynamic.sql.util;
17
18 import java.text.MessageFormat;
19 import java.util.ResourceBundle;
20
21 public class Messages {
22 private static final String BUNDLE_NAME = "org.mybatis.dynamic.sql.util.messages";
23
24 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
25
26 private Messages() {}
27
28 public static String getString(String key) {
29 return RESOURCE_BUNDLE.getString(key);
30 }
31
32 public static String getString(String key, String p1) {
33 return MessageFormat.format(getString(key), p1);
34 }
35
36 public static String getString(String key, String p1, String p2, String p3) {
37 return MessageFormat.format(getString(key), p1, p2, p3);
38 }
39
40 public static String getInternalErrorString(InternalError internalError) {
41 return MessageFormat.format(getString("INTERNAL.ERROR"), internalError.getNumber());
42 }
43 }