@Override public final Set<Details> review(Map<String, Set<Details>> linkedFrom, Details rootObject, Map<String, Set<Details>> linkedTo, Set<String> notNullable, boolean isErrorRules) throws GraphException { /* note all the model objects that may be adjusted in review */ final Set<Details> allTerms = GraphPolicy.allObjects(linkedFrom.values(), rootObject, linkedTo.values()); /* allow isAdjustedBeforeReview to adjust objects before review */ final Set<Details> changedTerms = new HashSet<Details>(); for (final Details object : allTerms) { if (isAdjustedBeforeReview(object)) { changedTerms.add(object); } } /* do the review */ changedTerms.addAll(graphPolicy.review(linkedFrom, rootObject, linkedTo, notNullable, isErrorRules)); /* allow isAdjustedAfterReview to adjust objects after review */ for (final Details object : allTerms) { if (isAdjustedAfterReview(object)) { changedTerms.add(object); } } return changedTerms; } }
if (!policyRule.termMatchers.isEmpty()) { final Set<Details> allTerms = GraphPolicy.allObjects(linkedFrom.values(), rootObject, linkedTo.values()); for (final TermMatch matcher : policyRule.termMatchers) { for (final Details object : allTerms) {
final Set<TermMatch> unmatchedTerms = new HashSet<TermMatch>(policyRule.termMatchers); final Set<Details> allTerms = unmatchedTerms.isEmpty() ? Collections.<Details>emptySet() : GraphPolicy.allObjects(linkedFrom.values(), rootObject, linkedTo.values()); final Set<RelationshipMatch> unmatchedRelationships = new HashSet<RelationshipMatch>(policyRule.relationshipMatchers); boolean isPossibleMatch = true;