1 7 8 21 22 package java.util; 23 24 import java.io.InputStream ; 25 import java.io.IOException ; 26 27 89 public class PropertyResourceBundle extends ResourceBundle { 90 94 public PropertyResourceBundle (InputStream stream) throws IOException { 95 Properties properties = new Properties (); 96 properties.load(stream); 97 lookup = new HashMap (properties); 98 } 99 100 public Object handleGetObject(String key) { 102 if (key == null) { 103 throw new NullPointerException (); 104 } 105 return lookup.get(key); 106 } 107 108 111 public Enumeration <String > getKeys() { 112 ResourceBundle parent = this.parent; 113 return new ResourceBundleEnumeration (lookup.keySet(), 114 (parent != null) ? parent.getKeys() : null); 115 } 116 117 119 private Map lookup; 120 } 121 | Popular Tags |