comparison gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java @ 690:254f062e334b

Added JavaDoc. gnv/trunk@908 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 12 Apr 2010 16:45:16 +0000
parents 57fa8019fbdc
children af22fa5567a6
comparison
equal deleted inserted replaced
689:8487581dfe3b 690:254f062e334b
3 import java.util.Map; 3 import java.util.Map;
4 4
5 import org.apache.log4j.Logger; 5 import org.apache.log4j.Logger;
6 6
7 /** 7 /**
8 * A <code>PropertiesReader</code> storing properties in a <code>Map</code>.
9 *
8 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> 10 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
9 * 11 *
10 */ 12 */
11 public class MapPropertiesReader implements PropertiesReader { 13 public class MapPropertiesReader implements PropertiesReader {
12 /** 14
13 * the logger, used to log exceptions and additonaly information
14 */
15 private static Logger log = Logger.getLogger(MapPropertiesReader.class); 15 private static Logger log = Logger.getLogger(MapPropertiesReader.class);
16 16
17 private Map<String, String> properties = null; 17 private Map<String, String> properties = null;
18 18
19 /** 19 /**
20 * Constructor 20 * Constructs a new MapPropertiesReader with an initial map.
21 */ 21 */
22 public MapPropertiesReader(Map<String, String> properties) { 22 public MapPropertiesReader(Map<String, String> properties) {
23 super(); 23 super();
24 this.properties = properties; 24 this.properties = properties;
25 } 25 }
26 26
27 /**
28 * @see de.intevation.gnv.propertiesreader.PropertiesReader#getPropertieValue(java.lang.String,
29 * java.lang.String)
30 */
31 public String getPropertieValue(String key, String defaultValue) { 27 public String getPropertieValue(String key, String defaultValue) {
32 String value = this.properties.get(key); 28 String value = this.properties.get(key);
33 if (value == null) { 29 if (value == null) {
34 value = defaultValue; 30 value = defaultValue;
35 } 31 }
36 return value; 32 return value;
37 } 33 }
38
39 } 34 }
35 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org