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: /* $Id: Localizable.java 447277 2006-09-18 06:19:34Z jeremias $ */
19:
20: package org.apache.xmlgraphics.util.i18n;
21:
22: import java.util.Locale;
23: import java.util.MissingResourceException;
24:
25: /**
26: * This interface must be implemented by the classes which must provide a
27: * way to override the default locale.
28: *
29: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
30: * @version $Id: Localizable.java 447277 2006-09-18 06:19:34Z jeremias $
31: */
32: public interface Localizable {
33: /**
34: * Provides a way to the user to specify a locale which override the
35: * default one. If null is passed to this method, the used locale
36: * becomes the global one.
37: * @param l The locale to set.
38: */
39: void setLocale(Locale l);
40:
41: /**
42: * Returns the current locale or null if the locale currently used is
43: * the default one.
44: */
45: Locale getLocale();
46:
47: /**
48: * Creates and returns a localized message, given the key of the message
49: * in the resource bundle and the message parameters.
50: * The messages in the resource bundle must have the syntax described in
51: * the java.text.MessageFormat class documentation.
52: * @param key The key used to retreive the message from the resource
53: * bundle.
54: * @param args The objects that compose the message.
55: * @exception MissingResourceException if the key is not in the bundle.
56: */
57: String formatMessage(String key, Object[] args)
58: throws MissingResourceException;
59: }
|