comparison flys-artifacts/src/main/java/de/intevation/flys/exports/TypeSection.java @ 3615:f84854eba0b3

Preparations for logo inclusion in charts. flys-artifacts/trunk@5278 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 28 Aug 2012 12:47:11 +0000
parents 76eeb3b4358e
children cbe2febe30cc
comparison
equal deleted inserted replaced
3614:68beaa827751 3615:f84854eba0b3
1 package de.intevation.flys.exports; 1 package de.intevation.flys.exports;
2
3 import org.apache.log4j.Logger;
2 4
3 import de.intevation.artifactdatabase.state.Attribute; 5 import de.intevation.artifactdatabase.state.Attribute;
4 import de.intevation.artifactdatabase.state.DefaultSection; 6 import de.intevation.artifactdatabase.state.DefaultSection;
5 7
6 8
7 /** 9 /**
8 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
9 */ 11 */
10 public class TypeSection extends DefaultSection { 12 public class TypeSection extends DefaultSection {
11 13
14 private static final Logger logger = Logger.getLogger(TypeSection.class);
15
12 public TypeSection(String key) { 16 public TypeSection(String key) {
13 super(key); 17 super(key);
18 }
19
20
21 public void setChoiceStringValue(String key, String value, String choiceType) {
22 if (value == null || value.length() == 0) {
23 return;
24 }
25
26 Attribute attr = getAttribute(key);
27 if (attr == null) {
28 attr = new ChoiceStringAttribute(key, value, true, choiceType);
29 addAttribute(key, attr);
30 }
31 else {
32 attr.setValue(value);
33 }
14 } 34 }
15 35
16 36
17 public void setStringValue(String key, String value) { 37 public void setStringValue(String key, String value) {
18 if (value == null || value.length() == 0) { 38 if (value == null || value.length() == 0) {
34 Attribute attr = getAttribute(key); 54 Attribute attr = getAttribute(key);
35 55
36 if (attr instanceof StringAttribute) { 56 if (attr instanceof StringAttribute) {
37 return (String) attr.getValue(); 57 return (String) attr.getValue();
38 } 58 }
59
60 logger.debug("attribute " + key + " not found in typesection.getString");
39 61
40 return null; 62 return null;
41 } 63 }
42 64
43 65

http://dive4elements.wald.intevation.org