commons-scan/src/main/java/com/xiongyingqi/util/PackageScanner.java
public Collection<Class<?>> scan() {
        Assert.notEmpty(packages, "待扫描的包为空！");
        Collection<Class<?>> classes = new ArrayList<Class<?>>();
        ClassLookupHelper.ClassFileFilter classFileFilter = new ClassLookupHelper.ClassFileFilter() {
            @Override
            public boolean accept(String klassName, File file, ClassLoader loader) {
                return true;
            }

            @Override
            public boolean accept(String klassName, JarFile jar, JarEntry entry, ClassLoader loader) {
                return true;
            }
        };
        for (Package pkg : packages) {
            Set<Class<?>> scanClasses = ClassLookupHelper.getClasses(pkg, recursive, classFileFilter);
            for (Class<?> scanClass : scanClasses) {
                if (isAnnotationPassed(scanClass) && isStartWithPassed(scanClass) && isInterfacePassed(scanClass)) {
                    classes.add(scanClass);
                }
            }
        }
        return classes;
    }
public Collection<Class<?>> scan() {
        Assert.notEmpty(packages, "待扫描的包为空！");
        Collection<Class<?>> classes = new ArrayList<Class<?>>();
        ClassLookupHelper.ClassFileFilter classFileFilter = new ClassLookupHelper.ClassFileFilter() {
            @Override
            public boolean accept(String klassName, File file, ClassLoader loader) {
                return true;
            }

            @Override
            public boolean accept(String klassName, JarFile jar, JarEntry entry, ClassLoader loader) {
                return true;
            }
        };
        for (Package pkg : packages) {
            Set<Class<?>> scanClasses = ClassLookupHelper.getClasses(pkg, recursive, classFileFilter);
            for (Class<?> scanClass : scanClasses) {
                if (isAnnotationPassed(scanClass) && isStartWithPassed(scanClass) && isInterfacePassed(scanClass)) {
                    classes.add(scanClass);
                }
            }
        }
        return classes;
    }
public Collection < Class < ? > > scan ( ) { Assert . notEmpty ( packages , "待扫描的包为空！"); Collection < Class < ? > > classes = new ArrayList < Class < ? > > ( ) ; ClassLookupHelper . ClassFileFilter classFileFilter = new ClassLookupHelper . ClassFileFilter ( ) { @ Override public boolean accept ( String klassName , File file , ClassLoader loader ) { return true ; } @ Override public boolean accept ( String klassName , JarFile jar , JarEntry entry , ClassLoader loader ) { return true ; } } ; for ( Package pkg : packages ) { Set < Class < ? > > scanClasses = ClassLookupHelper . getClasses ( pkg , recursive , classFileFilter ) ; for ( Class < ? > scanClass : scanClasses ) { if ( isAnnotationPassed ( scanClass ) && isStartWithPassed ( scanClass ) && isInterfacePassed ( scanClass ) ) { classes . add ( scanClass ) ; } } } return classes ; }
开始扫描

@return
开始扫描