Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java @ 2079:ca6ccf722c24
#447 removed empty Outputs from Collection's attribute.
flys-artifacts/trunk@3595 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 05 Jan 2012 13:39:58 +0000 |
parents | 85132c9edd64 |
children | 2a8919e0ed28 |
comparison
equal
deleted
inserted
replaced
2078:cbeeaaad1056 | 2079:ca6ccf722c24 |
---|---|
56 output.getType())); | 56 output.getType())); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 | 60 |
61 public void cleanEmptyOutputs() { | |
62 if (outputMap == null) { | |
63 return; | |
64 } | |
65 | |
66 List<String> removeUs = new ArrayList<String>(); | |
67 | |
68 Set<Map.Entry<String, Output>> entries = outputMap.entrySet(); | |
69 for (Map.Entry<String, Output> entry: entries) { | |
70 Output o = entry.getValue(); | |
71 | |
72 List<Facet> facets = o.getFacets(); | |
73 if (facets == null || facets.isEmpty()) { | |
74 removeUs.add(entry.getKey()); | |
75 } | |
76 } | |
77 | |
78 for (String key: removeUs) { | |
79 outputMap.remove(key); | |
80 } | |
81 } | |
82 | |
83 | |
61 public void setSettings(String outputKey, Settings settings) { | 84 public void setSettings(String outputKey, Settings settings) { |
62 if (settings == null) { | 85 if (settings == null) { |
63 logger.warn("Tried to set empty Settings for '" + outputKey + "'"); | 86 logger.warn("Tried to set empty Settings for '" + outputKey + "'"); |
64 return; | 87 return; |
65 } | 88 } |