use of com.hazelcast.internal.yaml.YamlScalar 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