KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > DefaultResourceBundle


1 /*
2 * JBoss, the OpenSource J2EE webOS
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */

7
8 // $Id: DefaultResourceBundle.java,v 1.2 2004/03/26 03:56:36 starksm Exp $
9

10 package org.jboss.net;
11
12 /**
13  * A resource bundle that allows us to fake i18n support.
14  * @author <a HREF="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>
15  * @created 28. September 2001, 13:04
16  * @version $Revision: 1.2 $
17  */

18
19 public class DefaultResourceBundle extends java.util.ResourceBundle JavaDoc
20 {
21
22    /** empty enumeration because we translate everything! */
23    static class EmptyEnumeration implements java.util.Enumeration JavaDoc
24    {
25       public boolean hasMoreElements()
26       {
27          return false;
28       }
29
30       public Object JavaDoc nextElement() throws java.util.NoSuchElementException JavaDoc
31       {
32          throw new java.util.NoSuchElementException JavaDoc();
33       }
34    }
35
36    /** itīs a flyweight! */
37    static java.util.Enumeration JavaDoc EMPTY_ENUMERATION = new EmptyEnumeration();
38
39    /** Creates new DefaultResourceBundle */
40    public DefaultResourceBundle()
41    {
42    }
43
44    /** do not support this correctly */
45    public java.util.Enumeration JavaDoc getKeys()
46    {
47       return EMPTY_ENUMERATION;
48    }
49
50    /** smart, isnīt it? */
51    protected java.lang.Object JavaDoc handleGetObject(java.lang.String JavaDoc str) throws java.util.MissingResourceException JavaDoc
52    {
53       return str;
54    }
55
56 }
57
Popular Tags