Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
114 brianR 1
/*
2
 *   Copyright 2013 Brian Rosenberger (Brutex Network)
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
 
17
package net.brutex.xservices.ws.impl;
18
 
19
import java.text.MessageFormat;
20
import java.util.MissingResourceException;
21
import java.util.ResourceBundle;
22
 
23
public class Messages
24
{
25
  private static final String BUNDLE_NAME = "net.brutex.xservices.ws.impl.messages";
26
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("net.brutex.xservices.ws.impl.messages");
27
 
28
  public static String getString(String key)
29
  {
30
    try
31
    {
32
      return RESOURCE_BUNDLE.getString(key); } catch (MissingResourceException e) {
33
    }
34
    return '!' + key + '!';
35
  }
36
 
37
  public static String getString(String key, Object[] params)
38
  {
39
    try {
40
      return MessageFormat.format(RESOURCE_BUNDLE.getString(key), params); } catch (MissingResourceException e) {
41
    }
42
    return '!' + key + '!';
43
  }
44
}