private MatcherState getMatcherState(String name, NodeState after) { List<Matcher> matched = Lists.newArrayList(); List<Matcher> inherited = Lists.newArrayList(); for (Matcher m : Iterables.concat(matcherState.inherited, currentMatchers)) { Matcher result = m.match(name, after); if (result.getStatus() == Matcher.Status.MATCH_FOUND){ matched.add(result); } if (result.getStatus() != Matcher.Status.FAIL){ inherited.addAll(result.nextSet()); } } if (!matched.isEmpty() || !inherited.isEmpty()) { return new MatcherState(matched, inherited); } return MatcherState.NONE; }
private MatcherState getMatcherState(String name, NodeState after) { List<Aggregate.Matcher> matched = Lists.newArrayList(); List<Aggregate.Matcher> inherited = Lists.newArrayList(); for (Aggregate.Matcher m : Iterables.concat(matcherState.inherited, currentMatchers)) { Aggregate.Matcher result = m.match(name, after); if (result.getStatus() == Aggregate.Matcher.Status.MATCH_FOUND){ matched.add(result); } if (result.getStatus() != Aggregate.Matcher.Status.FAIL){ inherited.addAll(result.nextSet()); } } if (!matched.isEmpty() || !inherited.isEmpty()) { return new MatcherState(matched, inherited); } return MatcherState.NONE; }
private MatcherState getMatcherState(String name, NodeState after) { List<Matcher> matched = Lists.newArrayList(); List<Matcher> inherited = Lists.newArrayList(); for (Matcher m : Iterables.concat(matcherState.inherited, currentMatchers)) { Matcher result = m.match(name, after); if (result.getStatus() == Matcher.Status.MATCH_FOUND){ matched.add(result); } if (result.getStatus() != Matcher.Status.FAIL){ inherited.addAll(result.nextSet()); } } if (!matched.isEmpty() || !inherited.isEmpty()) { return new MatcherState(matched, inherited); } return MatcherState.NONE; }
private static void matchChildren(List<Matcher> matchers, ResultCollector collector, Iterable<? extends ChildNodeEntry> children) { for (ChildNodeEntry cne : children) { List<Matcher> nextSet = newArrayListWithCapacity(matchers.size()); for (Matcher m : matchers) { Matcher result = m.match(cne.getName(), cne.getNodeState()); if (result.getStatus() == Matcher.Status.MATCH_FOUND){ result.collectResults(collector); } if (result.getStatus() != Matcher.Status.FAIL){ nextSet.addAll(result.nextSet()); } } if (!nextSet.isEmpty()) { collectAggregates(cne.getNodeState(), nextSet, collector); } } }