src/main/java/org/jboss/util/property/PropertyMap.java
/**
    * Load properties from a map.
    *
    * @param prefix  Prefix to append to all map keys (or null).
    * @param map     Map containing properties to load.
    * @throws PropertyException
    */
Load properties from a map.
@param prefix  Prefix to append to all map keys (or null).
@param map     Map containing properties to load.
Load properties from a map . @param prefix Prefix to append to all map keys ( or null ) . @param map Map containing properties to load .
public void load(String prefix, Map map) throws PropertyException
   {
      if (map == null)
         throw new NullArgumentException("map");
      Iterator iter = map.keySet().iterator();
      while (iter.hasNext())
      {
         String key = String.valueOf(iter.next());
         String name = makePrefixedPropertyName(key, prefix);
         String value = String.valueOf(map.get(name));
         setProperty(name, value);
      }
   }
public void load ( String prefix , Map map ) throws PropertyException { if ( map == null ) throw new NullArgumentException ( "map" ) ; Iterator iter = map . keySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { String key = String . valueOf ( iter . next ( ) ) ; String name = makePrefixedPropertyName ( key , prefix ) ; String value = String . valueOf ( map . get ( name ) ) ; setProperty ( name , value ) ; } }
Load properties from a map.
Load properties from a map .
// prefix can be null // set properties for each key in map // make a string key with optional prefix // set the property