KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > util > MessageFormatter


1 /*
2  * Copyright 1999-2002,2004 The Apache Software Foundation.
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 org.apache.xerces.util;
18
19 import java.util.Locale JavaDoc;
20 import java.util.MissingResourceException JavaDoc;
21
22 /**
23  * This interface provides a generic message formatting mechanism and
24  * is useful for producing messages that must be localed and/or formatted
25  * with replacement text.
26  *
27  * @see org.apache.xerces.impl.XMLErrorReporter
28  *
29  * @author Andy Clark
30  *
31  * @version $Id: MessageFormatter.java,v 1.6 2004/02/24 23:15:53 mrglavas Exp $
32  */

33 public interface MessageFormatter {
34
35     //
36
// MessageFormatter methods
37
//
38

39     /**
40      * Formats a message with the specified arguments using the given
41      * locale information.
42      *
43      * @param locale The locale of the message.
44      * @param key The message key.
45      * @param arguments The message replacement text arguments. The order
46      * of the arguments must match that of the placeholders
47      * in the actual message.
48      *
49      * @return Returns the formatted message.
50      *
51      * @throws MissingResourceException Thrown if the message with the
52      * specified key cannot be found.
53      */

54     public String JavaDoc formatMessage(Locale JavaDoc locale, String JavaDoc key, Object JavaDoc[] arguments)
55         throws MissingResourceException JavaDoc;
56
57 } // interface MessageFormatter
58
Popular Tags