private ClassInfoList.ClassInfoFilter createClassInfoFilter(boolean considerAnnotations) {
        Set<Predicate<String>> exclusions = Util.nullSafe(this.excludeClassNames).stream()
                .map(excludeEntry -> GlobHandler.createClassOrPackageNameFilter(excludeEntry, false))
                .collect(Collectors.toSet());
        Set<Predicate<String>> inclusions;
        if (considerAnnotations) {
            inclusions = Collections.singleton(input -> true);
        } else {
            inclusions = new HashSet<>();
            Util.nullSafe(this.classNames).stream()
                    .map(className -> GlobHandler.createClassOrPackageNameFilter(className, false))
                    .forEach(inclusions::add);
            Util.nullSafe(this.packageNames).stream()
                    .map(packageName -> GlobHandler.createClassOrPackageNameFilter(packageName, true))
                    .forEach(inclusions::add);
        }
        return element -> {
            String classPathEntry = element.getName().replaceAll("\\.", "/");
            if (exclusions.stream().anyMatch(exclude -> exclude.test(classPathEntry))) {
                this.getLog().debug("  Excluding: " + element.getName());
                return false;
            }
            if (inclusions.stream().anyMatch(include -> include.test(classPathEntry))) {
                this.getLog().debug("  Including: " + element.getName());
                return true;
            }
            return false;
        };
    }
Based on the plugin configuration, create a filter instance that determines whether a given classpath element should be considered.

@param considerAnnotations whether the plugin configuration includes looking up types by certain annotations
@return filter instance to apply on a ClassInfoList containing possibly eligible classpath elements
jsonschema-maven-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java