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

Sun, 12 Jan 2025 16:28:08 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 12 Jan 2025 16:28:08 +0100
changeset 135
9afe68b15c66
parent 113
24f32dbd88cd
permissions
-rw-r--r--

improve toolchain detection to also get the wordsize and stdc version, issue #439, issue #508

package de.unixwork.uwproj;

import org.w3c.dom.Element;

public final class ConfigVar {
    private final String varName;
    private final String value;
    private final boolean exec;

    public ConfigVar(Element e) {
        this(e, false);
    }

    public ConfigVar(Element e, boolean varNameIsElemName) {
        if (varNameIsElemName) {
            // take the node name literally and don't apply shId()
            varName = e.getNodeName().toUpperCase();
        } else {
            varName = e.getAttribute("name");
        }
        value = Util.getContent(e);
        exec = Boolean.parseBoolean(e.getAttribute("exec"));
    }

    public String getVarName() {
        return varName;
    }

    public String getValue() {
        return value;
    }

    public boolean isExec() {
        return exec;
    }
}

mercurial