Properties: setLastDefaults() v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 04 Jan 2014 21:21:04 +0100
branchv_0
changeset 133 a1bf1465df89
parent 132 f785ee7a70a2
child 134 f2510551b5bf
Properties: setLastDefaults()
java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java
--- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Sat Jan 04 21:20:48 2014 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Sat Jan 04 21:21:04 2014 +0100
@@ -59,10 +59,21 @@
 		this.defaults = defaults;
 	}
 
+	/**
+	 * @param defaults the last/deepest defaults
+	 */
+	public void setLastDefaults(Properties defaults) {
+		if (this.defaults == null) {
+			this.defaults = defaults;
+		} else {
+			this.defaults.setLastDefaults(defaults);
+		}
+	}
+
 	private Property findProperty(String name) {
 		Property p = findByName(this, name);
-		if (p == null) {
-			p = findByName(defaults, name);
+		if (p == null && defaults != null) {
+			p = defaults.findProperty(name);
 		}
 		return p;
 	}