@Test public void testAccepts_IncludedSimpleClassPattern_ExcludedPackagePrefix() { Map<String, Object> properties = new HashMap<>(); properties.put(OASConfig.SCAN_CLASSES, "(?:pkgA.My(Bean|Class))$"); properties.put(OASConfig.SCAN_EXCLUDE_PACKAGES, "com.example"); OpenApiConfig config = IndexScannerTestBase.dynamicConfig(properties); FilteredIndexView view = new FilteredIndexView(null, config); assertTrue(view.accepts(DotName.createSimple("com.example.pkgA.MyBean"))); assertTrue(view.accepts(DotName.createSimple("com.example.pkgA.MyClass"))); assertFalse(view.accepts(DotName.createSimple("com.example.pkgA.MyImpl"))); }
public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { accept = false; } else if (match.isQualifiedNameIncluded()) { accept = true; } else if (match.isSimpleNameExcluded()) { accept = false; } else if (match.isSimpleNameIncluded()) { accept = true; } else if (match.isPackageExcluded()) { accept = false; } else if (match.isPackageIncluded()) { accept = true; } else if (match.isImpliedInclusion()) { accept = true; } else { accept = false; } return accept; }
FilteredIndexView implements IndexView { public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { accept = false; } else if (match.isQualifiedNameIncluded()) { accept = true; } else if (match.isSimpleNameExcluded()) { accept = false; } else if (match.isSimpleNameIncluded()) { accept = true; } else if (match.isPackageExcluded()) { accept = false; } else if (match.isPackageIncluded()) { accept = true; } else if (match.isImpliedInclusion()) { accept = true; } else { accept = false; } return accept; } }
FilteredIndexView implements IndexView { public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { accept = false; } else if (match.isQualifiedNameIncluded()) { accept = true; } else if (match.isSimpleNameExcluded()) { accept = false; } else if (match.isSimpleNameIncluded()) { accept = true; } else if (match.isPackageExcluded()) { accept = false; } else if (match.isPackageIncluded()) { accept = true; } else if (match.isImpliedInclusion()) { accept = true; } else { accept = false; } return accept; } FilteredIndexView(IndexView delegate, OpenApiConfig config); }
FilteredIndexView implements IndexView { public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { accept = false; } else if (match.isQualifiedNameIncluded()) { accept = true; } else if (match.isSimpleNameExcluded()) { accept = false; } else if (match.isSimpleNameIncluded()) { accept = true; } else if (match.isPackageExcluded()) { accept = false; } else if (match.isPackageIncluded()) { accept = true; } else if (match.isImpliedInclusion()) { accept = true; } else { accept = false; } return accept; } FilteredIndexView(IndexView delegate, OpenApiConfig config); boolean accepts(DotName className); @Override Collection<ClassInfo> getKnownClasses(); @Override ClassInfo getClassByName(DotName className); @Override Collection<ClassInfo> getKnownDirectSubclasses(DotName className); @Override Collection<ClassInfo> getAllKnownSubclasses(DotName className); @Override Collection<ClassInfo> getKnownDirectImplementors(DotName className); @Override Collection<ClassInfo> getAllKnownImplementors(DotName interfaceName); @Override Collection<AnnotationInstance> getAnnotations(DotName annotationName); }
FilteredIndexView implements IndexView { public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { accept = false; } else if (match.isQualifiedNameIncluded()) { accept = true; } else if (match.isSimpleNameExcluded()) { accept = false; } else if (match.isSimpleNameIncluded()) { accept = true; } else if (match.isPackageExcluded()) { accept = false; } else if (match.isPackageIncluded()) { accept = true; } else if (match.isImpliedInclusion()) { accept = true; } else { accept = false; } return accept; } FilteredIndexView(IndexView delegate, OpenApiConfig config); boolean accepts(DotName className); @Override Collection<ClassInfo> getKnownClasses(); @Override ClassInfo getClassByName(DotName className); @Override Collection<ClassInfo> getKnownDirectSubclasses(DotName className); @Override Collection<ClassInfo> getAllKnownSubclasses(DotName className); @Override Collection<ClassInfo> getKnownDirectImplementors(DotName className); @Override Collection<ClassInfo> getAllKnownImplementors(DotName interfaceName); @Override Collection<AnnotationInstance> getAnnotations(DotName annotationName);  }