At 02:29 PM 22/08/01, you wrote:
>A big omission in java.util is that ResourceBundle does not implement Map 
>(nor any of the Java2 Collections interfaces).
>May I suggest that someone adds a new constructor to ExtendedProperties 
>that takes a ResourceBundle instance and copies
>its mapped data. This would make it easy to write code initialised from 
>resources (hence benefitting from the
>classloader's inherent features) and would also provide the exntended 
>features of ExtendedProperties.
>
>I'll volunteer to implement this if others think it is worthwhile.
>
>Rick
>

Sort of:


/**
  * Creates an extended properties object from a Hashtable
  */
public ExtendedProperties(ResourceBundle resourceBundle) {
   super();
   String key;
   Object value;
   for (Enumeration e = resourceBundle.getKeys() ; e.hasMoreElements() ;) {
     key = (String) e.nextElement();
     value = resourceBundle.getObject(key);
     put(key, value);
   }
}


Untested, untried...

Salu2.
Jim

--

                           *   Jim Cheesman   *
             Trabajo: 
[EMAIL PROTECTED] - (34)(91) 724 9200 x 2360
                Free advice is 
worth what you paid for it.


Reply via email to