1
2
3
4
5
6 package com.rc.celeritas.i18n;
7
8 import com.rc.celeritas.exception.CeleritasException;
9 import java.util.ResourceBundle;
10 import org.apache.log4j.Logger;
11
12
13
14
15
16 public class ResourceHelper {
17 private static ResourceBundle rb;
18
19 private static boolean _initialized = false;
20
21 private static Logger log = Logger.getLogger(ResourceHelper.class);
22
23
24
25
26
27
28 public static boolean init() throws CeleritasException{
29 if(_initialized){
30 return _initialized;
31 }
32 try{
33 rb = ResourceBundle.getBundle("messages");
34 }catch(Exception e){
35 log.error("Error in Initializing RB " + e.toString());
36 throw new CeleritasException(e);
37 }
38 return _initialized = true;
39 }
40
41
42
43
44
45
46 public String getValue(String key){
47 return rb.getString(key);
48 }
49 }