source: josm/trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlCondition.java@ 6890

Last change on this file since 6890 was 6890, checked in by Don-vip, 10 years ago

fix some Sonar issues (Constructor Calls Overridable Method)

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.mappaint.xml;
3
4import org.openstreetmap.josm.data.osm.OsmUtils;
5
6public class XmlCondition
7{
8 public String key;
9 public String value;
10 public String boolValue;
11
12 public XmlCondition() {
13 init();
14 }
15
16 public XmlCondition(XmlCondition c) {
17 key = c.key;
18 value = c.value;
19 boolValue = c.boolValue;
20 }
21
22 public String getKey() {
23 if(value != null)
24 return "n" + key + "=" + value;
25 else if(boolValue != null)
26 return "b" + key + "=" + OsmUtils.getNamedOsmBoolean(boolValue);
27 else
28 return "x" + key;
29 }
30
31 public final void init() {
32 key = value = boolValue = null;
33 }
34
35 public String toString() {
36 return "Rule["+key+","+(boolValue != null ? "b="+boolValue:"v="+value)+"]";
37 }
38
39 public void appendCode(StringBuilder sb) {
40 sb.append("[k=").append(key);
41
42 if (boolValue != null)
43 sb.append(",b=").append(boolValue);
44 else
45 sb.append(",v=").append(value);
46
47 sb.append("]");
48 }
49}
Note: See TracBrowser for help on using the repository browser.