1 /*
2 * This file is part of NetPisteur.
3 *
4 * Copyright 2001-2002 : Olivier CORNEC, David BOUANCHEAU, Loic LOPEZ,
5 * Gaetan BOUDARD, Mael LE LANNOU, Julien ROBINEAU
6 *
7 * Copyright 2002-2003 : Olivier BRIENS, Simon DEZE, Florence FRIGOULT,
8 * Olivier JOURNEAULT, Francois MARTINIER, Damien RAUDE-MORVAN
9 *
10 * Copyright 2004-2007 : Damien RAUDE-MORVAN
11 *
12 * NetPisteur is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * NetPisteur is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with NetPisteur; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 *
26 */
27 package com.drazzib.netpisteur.util;
28
29 import java.util.MissingResourceException;
30 import java.util.ResourceBundle;
31
32 /**
33 * @author drazzib
34 */
35 public class Messages {
36 private static final String BUNDLE_NAME = "com.drazzib.netpisteur.resources.messages";//$NON-NLS-1$
37
38 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
39 .getBundle(BUNDLE_NAME);
40
41 private Messages() {
42 }
43
44 public static String getString(String key) {
45 try {
46 return RESOURCE_BUNDLE.getString(key);
47 } catch (MissingResourceException e) {
48 return '!' + key + '!';
49 }
50 }
51 }