1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.obfuscator.export;
13 import java.text.MessageFormat;
14 import java.util.MissingResourceException;
15 import java.util.ResourceBundle;
18 * Utility class which helps managing messages
20 class ObfuscatorExportMessages {
21 private static final String RESOURCE_BUNDLE = "net.sourceforge.phpeclipse.obfuscator.export.messages";//$NON-NLS-1$
23 private static ResourceBundle bundle = ResourceBundle
24 .getBundle(RESOURCE_BUNDLE);
26 private ObfuscatorExportMessages() {
27 // prevent instantiation of class
31 * Returns the formatted message for the given key in the resource bundle.
36 * the message arguments
39 public static String format(String key, Object[] args) {
40 return MessageFormat.format(getString(key), args);
44 * Returns the resource object with the given key in the resource bundle. If
45 * there isn't any value under the given key, the key is returned.
51 public static String getString(String key) {
53 return bundle.getString(key);
54 } catch (MissingResourceException e) {