1 | /** |
2 | * BSD-style license; for more info see http://xradar.sourceforge.net/license.html |
3 | */ |
4 | package org.sourceforge.xradar; |
5 | |
6 | import java.util.MissingResourceException; |
7 | import java.util.ResourceBundle; |
8 | |
9 | public final class DefaultReportValues { |
10 | private static final String BUNDLE_NAME = "org.sourceforge.xradar.defaultValues"; //$NON-NLS-1$ |
11 | |
12 | private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle |
13 | .getBundle(BUNDLE_NAME); |
14 | |
15 | private DefaultReportValues() {} |
16 | |
17 | public static String getString(String key) { |
18 | try |
19 | { |
20 | return RESOURCE_BUNDLE.getString(key); |
21 | } |
22 | catch (MissingResourceException e) |
23 | { |
24 | //FIXME: Adding url into property produces this exception |
25 | // the following code is a workaround |
26 | if ( key.contains("xradar://")) |
27 | { |
28 | return key; |
29 | } |
30 | return '!' + key + '!'; |
31 | } |
32 | } |
33 | } |