public Matcher match(String name, NodeState nodeState) { boolean result = currentInclude.match(name, nodeState, depth); if (result){ if (hasMore()){ return new Matcher(this, Status.CONTINUE, depth, nodeState, path(name)); } else { return new Matcher(this, Status.MATCH_FOUND, depth, nodeState, path(name)); } } else { return new Matcher(this, Status.FAIL, depth); } }
@Override public boolean match(String name, NodeState nodeState, int depth) { //As per JR2 the primaryType is enforced on last element //last segment -> add to collector if node type matches if (depth == maxDepth() - 1 && primaryType != null && !matchingType(primaryType, nodeState)) { return false; } return super.match(name, nodeState, depth); }