return validationResults;
}
for (int i = 0; i < rootNode.getValue().size(); i++)
{
NodeTuple rootTuple = rootNode.getValue().get(i);
Node keyNode = rootTuple.getKeyNode();
if (keyNode.getNodeId() != scalar)
{
continue; //invalid key
}
String key = ((ScalarNode) keyNode).getValue();
if (key.equals("resourceTypes") || key.equals("traits"))
{
Node templateSequence = resolveInclude(rootTuple.getValueNode());
if (templateSequence != rootTuple.getValueNode())
{
rootNode.getValue().remove(i);
rootNode.getValue().add(i, new NodeTuple(keyNode, templateSequence));
}
if (templateSequence.getNodeId() != sequence)
{
validationResults.add(createErrorResult("Sequence expected", templateSequence));
rootNode.getValue().remove(i);
rootNode.getValue().add(i, new NodeTuple(keyNode, new SequenceNode(Tag.SEQ, new ArrayList<Node>(), false)));
break;
}
loopTemplateSequence((SequenceNode) templateSequence, key, validationResults);
}
}