PsiElementVisitor (@NotNull JsonValue root, @Nullable JsonSchemaObject schema, @NotNull JsonSchemaService service, @NotNull ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { if (schema == null) return PsiElementVisitor.EMPTY_VISITOR; JsonComplianceCheckerOptions options = new JsonComplianceCheckerOptions(myCaseInsensitiveEnum); return new JsonElementVisitor() { @Override public void visitElement(@NotNull PsiElement element) { if (element == root) { // perform this only for the root element, because the checker traverses the hierarchy itself annotate(element, schema, holder, session, options); } super.visitElement(element); } }; }