01: /**
02: *
03: */package nl.hippo.cms.wizard.components;
04:
05: import java.util.HashMap;
06: import java.util.Map;
07:
08: import org.xml.sax.Attributes;
09:
10: /**
11: * @author a.bogaart@hippo.nl
12: *
13: */
14: public class Configuration {
15: private Map mapValues;
16: private Attributes attsValues;
17:
18: public Configuration(Map mapValues) {
19: this .mapValues = mapValues;
20: }
21:
22: public Configuration(Attributes attsValues) {
23: this .attsValues = attsValues;
24: this .mapValues = new HashMap();
25: }
26:
27: public String get(String key) {
28: if (mapValues != null && mapValues.containsKey(key)) {
29: return (String) mapValues.get(key);
30: } else if (attsValues != null) {
31: return attsValues.getValue(key);
32: }
33: return null;
34: }
35:
36: //override attsValues by adding keys to mapValues
37: public void add(String key, String value) {
38: //if(!mapValues.containsKey(key))
39: mapValues.put(key, value);
40: }
41: }
|