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;
}
Aggregations