3 special type of propertylist, which has calls an fallback
4 if some key cannot be found.
6 this is ie useful to build up derivation hierachies
10 package org
.de
.metux
.propertylist
;
12 import java
.util
.Properties
;
14 public class FallbackPropertylist
extends Propertylist
16 IPropertylist fallback
;
18 public FallbackPropertylist(Properties p
)
24 public FallbackPropertylist(IPropertylist f
)
29 public String
get_raw(String key
)
32 String value
= super.get_raw(key
);
33 // System.err.println("FallbackPropertylist::get_raw(\""+key+"\") => \""+value+"\"");
38 // we have no fallbacks ... jump out
42 // for (int x=0; x<fallback.length; x++)
44 // if (fallback[x]!=null)
46 /// value = fallback[x].get_raw(key);
51 return fallback
.get_raw(key
);
56 public void setFallback(IPropertylist f
)
58 // fallback = new IPropertylist[1];
63 public String
toString()
65 return "[PRIMARY]\n"+super.toString()+
66 ((fallback
==null) ?
"" : "[FALLBACK]\n"+fallback
.toString());
69 public IPropertylist
clone()
71 // System.err.println("FallbackPropertylist::clone()");
72 // return new FallbackPropertylist(fallback[0]);
73 return new FallbackPropertylist(fallback
);