KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > i18n > CmsResourceBundle


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/i18n/CmsResourceBundle.java,v $
3  * Date : $Date: 2006/03/27 14:53:01 $
4  * Version: $Revision: 1.2 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (C) 2002 - 2005 Alkacon Software (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.i18n;
33
34 import java.io.IOException JavaDoc;
35 import java.io.InputStream JavaDoc;
36 import java.util.Locale JavaDoc;
37 import java.util.PropertyResourceBundle JavaDoc;
38 import java.util.ResourceBundle JavaDoc;
39
40 /**
41  * A property based resource bundle with increased visibility of some key methods.<p>
42  *
43  * This class is required because the methods {@link #setParent(ResourceBundle)} and
44  * {@link #setLocale(Locale)} are not visible in the standard implementation. However,
45  * access to these methods is required by the {@link org.opencms.i18n.CmsResourceBundleLoader}.<p>
46  *
47  * @author Alexander Kandzior
48  *
49  * @version $Revision: 1.2 $
50  *
51  * @since 6.2.0
52  *
53  * @see org.opencms.i18n.CmsResourceBundleLoader
54  */

55 public class CmsResourceBundle extends PropertyResourceBundle JavaDoc {
56
57     /** The locale to use. */
58     protected Locale JavaDoc m_locale;
59
60     /**
61      * Default constructer from parent class.<p>
62      *
63      * @param stream property file to read from
64      *
65      * @throws IOException in case the file could not be read from
66      */

67     public CmsResourceBundle(InputStream JavaDoc stream)
68     throws IOException JavaDoc {
69
70         super(stream);
71     }
72
73     /**
74      * @see java.util.ResourceBundle#getLocale()
75      */

76     public Locale JavaDoc getLocale() {
77
78         return m_locale;
79     }
80
81     /**
82      * Sets the locale used for this resource bundle.<p>
83      *
84      * @param l the locale to set
85      */

86     protected void setLocale(Locale JavaDoc l) {
87
88         m_locale = l;
89     }
90
91     /**
92      * @see java.util.ResourceBundle#setParent(java.util.ResourceBundle)
93      */

94     protected void setParent(ResourceBundle JavaDoc p) {
95
96         super.setParent(p);
97     }
98 }
Popular Tags