1 /* 2 3 Copyright 2000 The Apache Software Foundation 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 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.batik.i18n; 19 20 import java.util.Locale; 21 import java.util.MissingResourceException; 22 23 /** 24 * This interface must be implemented by the classes which must provide a 25 * way to override the default locale. 26 * 27 * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a> 28 * @version $Id: Localizable.java,v 1.3 2004/08/18 07:14:45 vhardy Exp $ 29 */ 30 public interface Localizable { 31 /** 32 * Provides a way to the user to specify a locale which override the 33 * default one. If null is passed to this method, the used locale 34 * becomes the global one. 35 * @param l The locale to set. 36 */ 37 void setLocale(Locale l); 38 39 /** 40 * Returns the current locale or null if the locale currently used is 41 * the default one. 42 */ 43 Locale getLocale(); 44 45 /** 46 * Creates and returns a localized message, given the key of the message 47 * in the resource bundle and the message parameters. 48 * The messages in the resource bundle must have the syntax described in 49 * the java.text.MessageFormat class documentation. 50 * @param key The key used to retreive the message from the resource 51 * bundle. 52 * @param args The objects that compose the message. 53 * @exception MissingResourceException if the key is not in the bundle. 54 */ 55 String formatMessage(String key, Object[] args) 56 throws MissingResourceException; 57 } 58