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); }