Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java @ 3:d7b4a77ba892
Infrastructur for Providing Applicationsettings
gnv/trunk@72 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 11 Sep 2009 15:19:52 +0000 |
parents | |
children | ad381cc47217 |
comparison
equal
deleted
inserted
replaced
2:5e94403971af | 3:d7b4a77ba892 |
---|---|
1 /** | |
2 * | |
3 */ | |
4 package de.intevation.gnv.propertiesreader; | |
5 | |
6 import java.util.Map; | |
7 | |
8 import org.apache.log4j.Logger; | |
9 | |
10 /** | |
11 * @author Tim Englich <tim.englich@intevation.de> | |
12 * | |
13 */ | |
14 public class MapPropertiesReader implements PropertiesReader { | |
15 /** | |
16 * the logger, used to log exceptions and additonaly information | |
17 */ | |
18 private static Logger log = Logger.getLogger(MapPropertiesReader.class); | |
19 | |
20 private Map<String,String> properties = null; | |
21 /** | |
22 * Constructor | |
23 */ | |
24 public MapPropertiesReader(Map<String, String> properties) { | |
25 super(); | |
26 this.properties = properties; | |
27 } | |
28 | |
29 /** | |
30 * @see de.intevation.gnv.propertiesreader.PropertiesReader#getPropertieValue(java.lang.String, java.lang.String) | |
31 */ | |
32 public String getPropertieValue(String key, String defaultValue) { | |
33 String value = this.properties.get(key); | |
34 if (value == null){ | |
35 value = defaultValue; | |
36 } | |
37 return value; | |
38 } | |
39 | |
40 } |