Properties: setLastDefaults() v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 04 Jan 2014 21:21:04 +0100
branchv_0
changeset 133a1bf1465df89
parent 132 f785ee7a70a2
child 134 f2510551b5bf
Properties: setLastDefaults()
java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Sat Jan 04 21:20:48 2014 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Sat Jan 04 21:21:04 2014 +0100
     1.3 @@ -59,10 +59,21 @@
     1.4  		this.defaults = defaults;
     1.5  	}
     1.6  
     1.7 +	/**
     1.8 +	 * @param defaults the last/deepest defaults
     1.9 +	 */
    1.10 +	public void setLastDefaults(Properties defaults) {
    1.11 +		if (this.defaults == null) {
    1.12 +			this.defaults = defaults;
    1.13 +		} else {
    1.14 +			this.defaults.setLastDefaults(defaults);
    1.15 +		}
    1.16 +	}
    1.17 +
    1.18  	private Property findProperty(String name) {
    1.19  		Property p = findByName(this, name);
    1.20 -		if (p == null) {
    1.21 -			p = findByName(defaults, name);
    1.22 +		if (p == null && defaults != null) {
    1.23 +			p = defaults.findProperty(name);
    1.24  		}
    1.25  		return p;
    1.26  	}