/** * Set the properties for the object that match the <code>prefix</code> passed as parameter. * <p> * @param properties The new properties value * @param prefix The new properties value */ public void setProperties( Properties properties, String prefix ) { int len = prefix.length(); for ( Enumeration<?> e = properties.propertyNames(); e.hasMoreElements(); ) { String key = (String) e.nextElement(); // handle only properties that start with the desired prefix. if ( key.startsWith( prefix ) ) { // ignore key if it contains dots after the prefix if ( key.indexOf( '.', len + 1 ) > 0 ) { //System.err.println("----------Ignoring---["+key // +"], prefix=["+prefix+"]."); continue; } String value = OptionConverter.findAndSubst( key, properties ); key = key.substring( len ); setProperty( key, value ); } } }
/** * Set the properties for the object that match the <code>prefix</code> passed as parameter. * <p> * @param properties The new properties value * @param prefix The new properties value */ public void setProperties( Properties properties, String prefix ) { int len = prefix.length(); for ( Enumeration<?> e = properties.propertyNames(); e.hasMoreElements(); ) { String key = (String) e.nextElement(); // handle only properties that start with the desired prefix. if ( key.startsWith( prefix ) ) { // ignore key if it contains dots after the prefix if ( key.indexOf( '.', len + 1 ) > 0 ) { //System.err.println("----------Ignoring---["+key // +"], prefix=["+prefix+"]."); continue; } String value = OptionConverter.findAndSubst( key, properties ); key = key.substring( len ); setProperty( key, value ); } } }
setProperty( prop, name, value );
setProperty( prop, name, value );