private boolean firstProcessObjectWithRule(Object checkObject, String checkContext, Rule rule) { Boolean deferred = rule.getDeferred(); if (deferred != null && deferred.booleanValue()) { List<ObjectWithContext> list = this.deferredRules.get(rule); if (list == null) { list = new ArrayList<>(); this.deferredRules.put(rule, list); } list.add(new ObjectWithContext(checkObject, checkContext)); return true; } return checkObjWithRule(checkObject, checkContext, rule); }
protected ValidationResult validate(Object root) throws ValidationException { initialise(); this.rootType = root.getObjectType(); this.objectsStack.push(root); this.objectsContext.push("root"); Set<String> rootIDContext = new HashSet<>(); if (root.getID() != null) { rootIDContext.add(root.getID()); this.idSet.add(root.getID()); } this.contextSet.push(rootIDContext); while (!this.objectsStack.isEmpty() && !this.abortProcessing) { checkNext(); } for (Map.Entry<Rule, List<ObjectWithContext>> entry : this.deferredRules.entrySet()) { for (ObjectWithContext objectWithContext : entry.getValue()) { checkObjWithRule(objectWithContext.getObject(), objectWithContext.getContext(), entry.getKey()); } } JavaScriptEvaluator.exitContext(); return ValidationResults.resultFromValues(this.profile, this.results, this.isCompliant, this.testCounter); }
protected ValidationResult validate(Object root) throws ValidationException { initialise(); this.rootType = root.getObjectType(); this.objectsStack.push(root); this.objectsContext.push("root"); Set<String> rootIDContext = new HashSet<>(); if (root.getID() != null) { rootIDContext.add(root.getID()); this.idSet.add(root.getID()); } this.contextSet.push(rootIDContext); while (!this.objectsStack.isEmpty() && !this.abortProcessing) { checkNext(); } for (Map.Entry<Rule, List<ObjectWithContext>> entry : this.deferredRules.entrySet()) { for (ObjectWithContext objectWithContext : entry.getValue()) { checkObjWithRule(objectWithContext.getObject(), objectWithContext.getContext(), entry.getKey()); } } JavaScriptEvaluator.exitContext(); return ValidationResults.resultFromValues(this.profile, this.results, this.isCompliant, this.testCounter); }
private boolean firstProcessObjectWithRule(Object checkObject, String checkContext, Rule rule) { Boolean deferred = rule.getDeferred(); if (deferred != null && deferred.booleanValue()) { List<ObjectWithContext> list = this.deferredRules.get(rule); if (list == null) { list = new ArrayList<>(); this.deferredRules.put(rule, list); } list.add(new ObjectWithContext(checkObject, checkContext)); return true; } return checkObjWithRule(checkObject, checkContext, rule); }