KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > filebuffers > NLSUtility


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.filebuffers;
12
13 import com.ibm.icu.text.MessageFormat;
14
15
16 /**
17  * A number of routines used for string externalization.
18  *
19  * @since 3.1
20  */

21 public class NLSUtility {
22
23     /**
24      * Formats the given string with the given argument.
25      *
26      * @param message the message to format, must not be <code>null</code>
27      * @param argument the argument used to format the string
28      * @return the formatted string
29      */

30     public static String JavaDoc format(String JavaDoc message, Object JavaDoc argument) {
31         return MessageFormat.format(message, new Object JavaDoc[] { argument });
32     }
33
34     /**
35      * Formats the given string with the given argument.
36      *
37      * @param message the message to format, must not be <code>null</code>
38      * @param arguments the arguments used to format the string
39      * @return the formatted string
40      */

41     public static String JavaDoc format(String JavaDoc message, Object JavaDoc[] arguments) {
42         return MessageFormat.format(message, arguments);
43     }
44
45     private NLSUtility() {
46         // Do not instantiate
47
}
48 }
49
Popular Tags