Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/themes/ThemeMapping.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 2c8e5bad8699 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
19 /** | 19 /** |
20 * Represents mapping to a theme (including conditions). | 20 * Represents mapping to a theme (including conditions). |
21 */ | 21 */ |
22 public class ThemeMapping implements Serializable { | 22 public class ThemeMapping implements Serializable { |
23 | 23 |
24 /** The logger that is used in this class */ | 24 /** The log that is used in this class */ |
25 private static Logger logger = Logger.getLogger(ThemeMapping.class); | 25 private static Logger log = Logger.getLogger(ThemeMapping.class); |
26 | 26 |
27 /** Name from which to map. */ | 27 /** Name from which to map. */ |
28 protected String from; | 28 protected String from; |
29 | 29 |
30 /** Name to which to map. */ | 30 /** Name to which to map. */ |
96 return true; | 96 return true; |
97 } | 97 } |
98 Matcher m = pattern.matcher(text); | 98 Matcher m = pattern.matcher(text); |
99 | 99 |
100 if (m.matches()) { | 100 if (m.matches()) { |
101 logger.debug("Pattern matches: " + text); | 101 log.debug("Pattern matches: " + text); |
102 return true; | 102 return true; |
103 } | 103 } |
104 else { | 104 else { |
105 logger.debug( | 105 log.debug( |
106 "Pattern '"+ text + "' does not match: " + this.patternStr); | 106 "Pattern '"+ text + "' does not match: " + this.patternStr); |
107 return false; | 107 return false; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
125 } | 125 } |
126 | 126 |
127 // Operator split. | 127 // Operator split. |
128 String[] parts = masterAttr.split("=="); | 128 String[] parts = masterAttr.split("=="); |
129 if (parts.length != 2) { | 129 if (parts.length != 2) { |
130 logger.error("ThemeMapping could not parse masterAttr.-condition:_" | 130 log.error("ThemeMapping could not parse masterAttr.-condition:_" |
131 + masterAttr + "_"); | 131 + masterAttr + "_"); |
132 return false; | 132 return false; |
133 } | 133 } |
134 | 134 |
135 // Test. | 135 // Test. |
136 String artData = artifact.getDataAsString(parts[0]); | 136 String artData = artifact.getDataAsString(parts[0]); |
137 if (artData != null && artData.equals(parts[1])) { | 137 if (artData != null && artData.equals(parts[1])) { |
138 logger.debug("Matches master Attribute."); | 138 log.debug("Matches master Attribute."); |
139 return true; | 139 return true; |
140 } | 140 } |
141 else { | 141 else { |
142 logger.debug("Does not match master Attribute."); | 142 log.debug("Does not match master Attribute."); |
143 return false; | 143 return false; |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 | 147 |
153 if (this.output == null || this.output.length() == 0) { | 153 if (this.output == null || this.output.length() == 0) { |
154 return true; | 154 return true; |
155 } | 155 } |
156 | 156 |
157 if (this.output.equals(output)) { | 157 if (this.output.equals(output)) { |
158 logger.debug("Output matches this mapping: " + output); | 158 log.debug("Output matches this mapping: " + output); |
159 return true; | 159 return true; |
160 } | 160 } |
161 else { | 161 else { |
162 logger.debug("Output '"+ output +"' does not match: "+ this.output); | 162 log.debug("Output '"+ output +"' does not match: "+ this.output); |
163 return false; | 163 return false; |
164 } | 164 } |
165 } | 165 } |
166 } | 166 } |
167 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 167 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |