src/main/java/de/unixwork/uwproj/Feature.java

changeset 79
ef0635b78b7b
parent 45
f4ec2feccebb
child 97
1af1bfacd25a
equal deleted inserted replaced
78:c3a62e0baa9e 79:ef0635b78b7b
8 import static de.unixwork.uwproj.Util.shId; 8 import static de.unixwork.uwproj.Util.shId;
9 9
10 public class Feature { 10 public class Feature {
11 private String name; 11 private String name;
12 private String arg; 12 private String arg;
13 private boolean def; 13 private boolean auto;
14 14
15 private TargetData targetData; 15 private TargetData targetData;
16 16
17 public static Feature parse(Project project, Element e) throws Exception { 17 public static Feature parse(Project project, Element e) throws Exception {
18 Feature feature = new Feature(); 18 Feature feature = new Feature();
19 String name = e.getAttribute("name"); 19 String name = e.getAttribute("name");
20 String arg = e.getAttribute("arg"); 20 String arg = e.getAttribute("arg");
21 String def = e.getAttribute("default"); 21 String auto = e.getAttribute("default");
22 22
23 if (name.isBlank()) { 23 if (name.isBlank()) {
24 throw new Exception("feature element requires name attribute"); 24 throw new Exception("feature element requires name attribute");
25 } 25 }
26 26
27 feature.setName(name); 27 feature.setName(name);
28 feature.setDefault(Boolean.parseBoolean(def)); 28 feature.setAuto(Boolean.parseBoolean(auto));
29 if (arg.isBlank()) { 29 if (arg.isBlank()) {
30 feature.setArg(name); 30 feature.setArg(name);
31 } else { 31 } else {
32 feature.setArg(arg); 32 feature.setArg(arg);
33 } 33 }
71 71
72 public void setArg(String arg) { 72 public void setArg(String arg) {
73 this.arg = arg; 73 this.arg = arg;
74 } 74 }
75 75
76 public boolean isDefault() { 76 public boolean isAuto() {
77 return def; 77 return auto;
78 } 78 }
79 79
80 public void setDefault(boolean def) { 80 public void setAuto(boolean auto) {
81 this.def = def; 81 this.auto = auto;
82 } 82 }
83 83
84 public TargetData getTargetData() { 84 public TargetData getTargetData() {
85 return targetData; 85 return targetData;
86 } 86 }

mercurial