Search in sources :

Example 6 with Scanner

use of com.buschmais.jqassistant.core.scanner.api.Scanner in project jqa-java-plugin by buschmais.

the class AbstractJavaPluginIT method scanClassPathResources.

protected void scanClassPathResources(final Scope scope, String artifactId, final String... resources) throws IOException {
    final File directory = getClassesDirectory(this.getClass());
    execute(artifactId, new ScanClassPathOperation() {

        @Override
        public List<FileDescriptor> scan(JavaArtifactFileDescriptor artifact, Scanner scanner) {
            List<FileDescriptor> result = new ArrayList<>();
            for (String resource : resources) {
                File file = new File(directory, resource);
                FileDescriptor fileDescriptor = scanner.scan(file, resource, scope);
                result.add(fileDescriptor);
            }
            return result;
        }
    });
}
Also used : Scanner(com.buschmais.jqassistant.core.scanner.api.Scanner) ArrayList(java.util.ArrayList) List(java.util.List) JavaArtifactFileDescriptor(com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor) File(java.io.File) JavaArtifactFileDescriptor(com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor) FileDescriptor(com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor)

Aggregations

Scanner (com.buschmais.jqassistant.core.scanner.api.Scanner)6 JavaArtifactFileDescriptor (com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor)6 FileDescriptor (com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor)5 List (java.util.List)5 File (java.io.File)3 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 JavaClassesDirectoryDescriptor (com.buschmais.jqassistant.plugin.java.api.model.JavaClassesDirectoryDescriptor)2 ScannerContext (com.buschmais.jqassistant.core.scanner.api.ScannerContext)1 ArtifactFileDescriptor (com.buschmais.jqassistant.plugin.common.api.model.ArtifactFileDescriptor)1 ContainerFileResolver (com.buschmais.jqassistant.plugin.common.api.scanner.ContainerFileResolver)1 AbstractFileResource (com.buschmais.jqassistant.plugin.common.api.scanner.filesystem.AbstractFileResource)1 FileResource (com.buschmais.jqassistant.plugin.common.api.scanner.filesystem.FileResource)1 ClassFileDescriptor (com.buschmais.jqassistant.plugin.java.api.model.ClassFileDescriptor)1 ServiceLoaderDescriptor (com.buschmais.jqassistant.plugin.java.api.model.ServiceLoaderDescriptor)1 TypeDescriptor (com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor)1 A (com.buschmais.jqassistant.plugin.java.test.set.scanner.resolver.A)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Collections.singletonList (java.util.Collections.singletonList)1