14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.tools.internal.xjc; 27 28 import java.text.MessageFormat; 29 import java.util.ResourceBundle; 30 31 /** 32 * Formats error messages. 33 */ 34 class Messages 35 { 36 /** Loads a string resource and formats it with specified arguments. */ 37 static String format( String property, Object... args ) { 38 String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property); 39 return MessageFormat.format(text,args); 40 } 41 42 // 43 // 44 // Message resources 45 // 46 // 47 static final String UNKNOWN_LOCATION = // 0 args 48 "ConsoleErrorReporter.UnknownLocation"; 49 50 static final String LINE_X_OF_Y = // 2 args 51 "ConsoleErrorReporter.LineXOfY"; 52 53 static final String UNKNOWN_FILE = // 0 args 54 "ConsoleErrorReporter.UnknownFile"; 55 56 static final String DRIVER_PUBLIC_USAGE = // 0 args 57 "Driver.Public.Usage"; | 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.tools.internal.xjc; 27 28 import java.text.MessageFormat; 29 import java.util.ResourceBundle; 30 31 /** 32 * Formats error messages. 33 */ 34 public class Messages 35 { 36 /** Loads a string resource and formats it with specified arguments. */ 37 public static String format( String property, Object... args ) { 38 String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property); 39 return MessageFormat.format(text,args); 40 } 41 42 // 43 // 44 // Message resources 45 // 46 // 47 static final String UNKNOWN_LOCATION = // 0 args 48 "ConsoleErrorReporter.UnknownLocation"; 49 50 static final String LINE_X_OF_Y = // 2 args 51 "ConsoleErrorReporter.LineXOfY"; 52 53 static final String UNKNOWN_FILE = // 0 args 54 "ConsoleErrorReporter.UnknownFile"; 55 56 static final String DRIVER_PUBLIC_USAGE = // 0 args 57 "Driver.Public.Usage"; |