use of com.hazelcast.internal.yaml.YamlNameNodePair in project hazelcast by hazelcast.
the class AbstractYamlConfigBuilder method fillReplacerProperties.
private void fillReplacerProperties(Node node, Properties properties) {
YamlMapping propertiesMapping = asMapping(((YamlElementAdapter) node).getYamlNode());
for (YamlNameNodePair childNodePair : propertiesMapping.childrenPairs()) {
String childName = childNodePair.nodeName();
YamlNode child = childNodePair.childNode();
Object nodeValue = asScalar(child).nodeValue();
properties.put(childName, nodeValue != null ? nodeValue.toString() : "");
}
}
use of com.hazelcast.internal.yaml.YamlNameNodePair in project hazelcast by hazelcast.
the class YamlDomChecker method check.
/**
* Performs {code @null} checks on the provided YAML node recursively.
*
* @param node The YAML node to check for {@code null}s
*/
public static void check(YamlNode node) {
if (node instanceof YamlMapping) {
for (YamlNameNodePair nodePair : ((YamlMapping) node).childrenPairs()) {
YamlNode child = nodePair.childNode();
if (child == null) {
String path = YamlUtil.constructPath(node, nodePair.nodeName());
reportNullEntryOnConcretePath(path);
}
check(nodePair.childNode());
}
} else if (node instanceof YamlSequence) {
for (YamlNode child : ((YamlSequence) node).children()) {
if (child == null) {
throw new InvalidConfigurationException("There is a null configuration entry under sequence " + node.path() + ". Please check if the provided YAML configuration is well-indented and no blocks started without " + "sub-nodes.");
}
check(child);
}
} else {
if (((YamlScalar) node).nodeValue() == null) {
reportNullEntryOnConcretePath(node.path());
}
}
}
Aggregations