tracefw/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/engine/rules/Messages.java
equal
deleted
inserted
replaced
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * Localized strings for rules package |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracecompiler.engine.rules; |
|
20 |
|
21 import java.util.MissingResourceException; |
|
22 import java.util.ResourceBundle; |
|
23 |
|
24 /** |
|
25 * Localized strings for rules package |
|
26 * |
|
27 */ |
|
28 class Messages { |
|
29 |
|
30 /** |
|
31 * Bundle name |
|
32 */ |
|
33 private static final String BUNDLE_NAME = "com.nokia.tracecompiler.engine.rules.messages"; //$NON-NLS-1$ |
|
34 |
|
35 /** |
|
36 * Bundle |
|
37 */ |
|
38 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle |
|
39 .getBundle(BUNDLE_NAME); |
|
40 |
|
41 /** |
|
42 * Prevents construction |
|
43 */ |
|
44 private Messages() { |
|
45 |
|
46 } |
|
47 |
|
48 /** |
|
49 * Gets localized string based on key |
|
50 * |
|
51 * @param key |
|
52 * the resource key |
|
53 * @return the localized resource |
|
54 */ |
|
55 public static String getString(String key) { |
|
56 String value; |
|
57 try { |
|
58 value = RESOURCE_BUNDLE.getString(key); |
|
59 } catch (MissingResourceException e) { |
|
60 value = '!' + key + '!'; |
|
61 } |
|
62 return value; |
|
63 } |
|
64 } |
|