Example usage for org.apache.commons.configuration.tree ConfigurationNode getChildren

List of usage examples for org.apache.commons.configuration.tree ConfigurationNode getChildren

Introduction

In this page you can find the example usage for org.apache.commons.configuration.tree ConfigurationNode getChildren.

Prototype

List getChildren(String name);

Source Link

Document

Returns a list with all children of this node with the given name.

Usage

From source file:org.apache.zeppelin.conf.ZeppelinConfiguration.java

private long getLongValue(String name, long d) {
    List<ConfigurationNode> properties = getRootNode().getChildren();
    if (properties == null || properties.size() == 0) {
        return d;
    }/*from w ww. j a  v  a  2  s . com*/
    for (ConfigurationNode p : properties) {
        if (p.getChildren("name") != null && p.getChildren("name").size() > 0
                && name.equals(p.getChildren("name").get(0).getValue())) {
            return Long.parseLong((String) p.getChildren("value").get(0).getValue());
        }
    }
    return d;
}

From source file:org.apache.zeppelin.conf.ZeppelinConfiguration.java

private float getFloatValue(String name, float d) {
    List<ConfigurationNode> properties = getRootNode().getChildren();
    if (properties == null || properties.size() == 0) {
        return d;
    }/*from w  w  w  .  j  a va2 s.  c  o m*/
    for (ConfigurationNode p : properties) {
        if (p.getChildren("name") != null && p.getChildren("name").size() > 0
                && name.equals(p.getChildren("name").get(0).getValue())) {
            return Float.parseFloat((String) p.getChildren("value").get(0).getValue());
        }
    }
    return d;
}

From source file:org.apache.zeppelin.conf.ZeppelinConfiguration.java

private boolean getBooleanValue(String name, boolean d) {
    List<ConfigurationNode> properties = getRootNode().getChildren();
    if (properties == null || properties.size() == 0) {
        return d;
    }//from w w w. j a va2s .  c om
    for (ConfigurationNode p : properties) {
        if (p.getChildren("name") != null && p.getChildren("name").size() > 0
                && name.equals(p.getChildren("name").get(0).getValue())) {
            return Boolean.parseBoolean((String) p.getChildren("value").get(0).getValue());
        }
    }
    return d;
}

From source file:org.zaproxy.zap.extension.quickstart.ExtensionQuickStart.java

private ConfigurationNode getFirstChildNode(ConfigurationNode node, String childName) {
    List<ConfigurationNode> list = node.getChildren(childName);
    if (list.size() > 0) {
        return list.get(0);
    }/*w  ww. j av a 2 s  .  c o m*/
    return null;
}