this.latestNodeVerified = false;
}
else if (node instanceof TwigQueryNode) {
final ArrayList<QueryNode> actualQueryNodeList = this.queryNodeList;
final TwigQueryNode twigNode = (TwigQueryNode) node;
final QueryNode root = twigNode.getRoot();
final QueryNode child = twigNode.getChild();
if (!(root instanceof WildcardNodeQueryNode)) { // the root is not empty
twigNode.setRoot(this.process(root));
}
if (!(child instanceof WildcardNodeQueryNode)) { // the child is not empty
twigNode.setChild(this.process(child));
}
actualQueryNodeList.add(twigNode);
this.queryNodeList = actualQueryNodeList;
this.latestNodeVerified = false;
}
else if (node instanceof ArrayQueryNode) {
final ArrayList<QueryNode> actualQueryNodeList = this.queryNodeList;
final ArrayQueryNode arrayNode = (ArrayQueryNode) node;
final List<QueryNode> children = arrayNode.getChildren();
final List<QueryNode> newChildren = new ArrayList<QueryNode>();
for (final QueryNode child : children) {
// The unary modifier sets the occurrence of this value in the TwigQuery
if (!(child instanceof ModifierQueryNode)) {
newChildren.add(this.process(child));
} else {
newChildren.add(child);
}
}
arrayNode.set(newChildren);
actualQueryNodeList.add(arrayNode);
this.queryNodeList = actualQueryNodeList;
this.latestNodeVerified = false;
}
else if (node instanceof TopLevelQueryNode) {
final ArrayList<QueryNode> actualQueryNodeList = this.queryNodeList;
final TopLevelQueryNode topNode = (TopLevelQueryNode) node;
final QueryNode child = topNode.getChildren().get(0);
topNode.set(Arrays.asList(this.process(child)));
actualQueryNodeList.add(topNode);
this.queryNodeList = actualQueryNodeList;
this.latestNodeVerified = false;
}
else if (node instanceof DatatypeQueryNode) {
final ArrayList<QueryNode> actualQueryNodeList = this.queryNodeList;
final DatatypeQueryNode dtNode = (DatatypeQueryNode) node;
final QueryNode child = dtNode.getChild();
dtNode.set(Arrays.asList(this.applyModifier(this.process(child), node.getParent())));
actualQueryNodeList.add(dtNode);
this.queryNodeList = actualQueryNodeList;
this.latestNodeVerified = false;
}