01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.util;
19:
20: import java.util.Locale;
21: import java.util.MissingResourceException;
22:
23: /**
24: * This interface provides a generic message formatting mechanism and
25: * is useful for producing messages that must be localed and/or formatted
26: * with replacement text.
27: *
28: * @see org.apache.xerces.impl.XMLErrorReporter
29: *
30: * @author Andy Clark
31: *
32: * @version $Id: MessageFormatter.java 447241 2006-09-18 05:12:57Z mrglavas $
33: */
34: public interface MessageFormatter {
35:
36: //
37: // MessageFormatter methods
38: //
39:
40: /**
41: * Formats a message with the specified arguments using the given
42: * locale information.
43: *
44: * @param locale The locale of the message.
45: * @param key The message key.
46: * @param arguments The message replacement text arguments. The order
47: * of the arguments must match that of the placeholders
48: * in the actual message.
49: *
50: * @return Returns the formatted message.
51: *
52: * @throws MissingResourceException Thrown if the message with the
53: * specified key cannot be found.
54: */
55: public String formatMessage(Locale locale, String key,
56: Object[] arguments) throws MissingResourceException;
57:
58: } // interface MessageFormatter
|