Search in sources :

Example 1 with ContainerFileResolver

use of com.buschmais.jqassistant.plugin.common.api.scanner.ContainerFileResolver in project jqa-java-plugin by buschmais.

the class AbstractJavaPluginIT method execute.

/**
     * Executes the given scan operation.
     * 
     * @param artifactId
     *            The artifact id of the artifact to push on the context.
     * @param operation
     *            The operation.
     */
protected List<? extends FileDescriptor> execute(String artifactId, ScanClassPathOperation operation) {
    Scanner scanner = getScanner();
    ScannerContext context = scanner.getContext();
    store.beginTransaction();
    JavaArtifactFileDescriptor artifact = getArtifactDescriptor(artifactId);
    artifact.setFullQualifiedName(artifactId);
    context.push(JavaArtifactFileDescriptor.class, artifact);
    ContainerFileResolver fileResolverStrategy = new ContainerFileResolver(artifact);
    context.push(FileResolver.class, fileResolverStrategy);
    List<? extends FileDescriptor> descriptors = execute(artifact, operation, scanner);
    for (FileDescriptor descriptor : descriptors) {
        fileResolverStrategy.put(descriptor.getFileName(), descriptor);
    }
    context.pop(JavaArtifactFileDescriptor.class);
    context.pop(FileResolver.class);
    fileResolverStrategy.flush();
    store.commitTransaction();
    return descriptors;
}
Also used : Scanner(com.buschmais.jqassistant.core.scanner.api.Scanner) ContainerFileResolver(com.buschmais.jqassistant.plugin.common.api.scanner.ContainerFileResolver) JavaArtifactFileDescriptor(com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor) ScannerContext(com.buschmais.jqassistant.core.scanner.api.ScannerContext) 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)1 ScannerContext (com.buschmais.jqassistant.core.scanner.api.ScannerContext)1 FileDescriptor (com.buschmais.jqassistant.plugin.common.api.model.FileDescriptor)1 ContainerFileResolver (com.buschmais.jqassistant.plugin.common.api.scanner.ContainerFileResolver)1 JavaArtifactFileDescriptor (com.buschmais.jqassistant.plugin.java.api.model.JavaArtifactFileDescriptor)1