Sat, 20 Jan 2024 15:47:39 +0100
improve toolchain detection
relates to #347
package de.unixwork.uwproj; import org.w3c.dom.Element; public class ConfigVar { private String varName; private String value; private boolean exec = false; public static ConfigVar parse(Element e) { return parse(e, false); } public static ConfigVar parse(Element e, boolean varNameIsElemName) { ConfigVar var = new ConfigVar(); if (varNameIsElemName) { // take the node name literally and don't apply shId() var.varName = e.getNodeName().toUpperCase(); } else { String name = e.getAttribute("name"); if (name.isBlank()) { System.err.println("<var>-element: name attribute required"); return null; } var.varName = name; } var.value = Util.getContent(e); var.exec = Boolean.parseBoolean(e.getAttribute("exec")); return var; } public String getVarName() { return varName; } public String getValue() { return value; } public boolean isExec() { return exec; } }