KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > common > util > LocalizedPropertyResourceBundle


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Forums JBoss Portlet *
6  * *
7  * Distributable under LGPL license. *
8  * See terms of license at gnu.org. *
9  * *
10  *****************************************/

11 package org.jboss.portal.common.util;
12
13 import java.util.PropertyResourceBundle JavaDoc;
14 import java.util.Locale JavaDoc;
15 import java.io.InputStream JavaDoc;
16 import java.io.IOException JavaDoc;
17
18 /**
19  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
20  * @version $Revision: 1.1 $
21  */

22 public class LocalizedPropertyResourceBundle extends PropertyResourceBundle JavaDoc
23 {
24
25    private final Locale JavaDoc locale;
26
27    /**
28     * Create an instanceof of localized property resource bundle.
29     *
30     * @param stream the stream to decode the property file
31     * @param locale the locale to use
32     * @throws IllegalArgumentException if the locale is null
33     */

34    public LocalizedPropertyResourceBundle(InputStream JavaDoc stream, Locale JavaDoc locale) throws IOException JavaDoc
35    {
36       super(stream);
37       if (locale == null)
38       {
39          throw new IllegalArgumentException JavaDoc("Locale cannot be null");
40       }
41       this.locale = locale;
42    }
43
44    public Locale JavaDoc getLocale()
45    {
46       return locale;
47    }
48 }
49
Popular Tags