use of com.buschmais.jqassistant.plugin.common.api.model.DirectoryDescriptor in project jqa-java-plugin by buschmais.
the class PackageDirectoryScannerPlugin method scan.
@Override
public PackageDescriptor scan(DirectoryResource item, String path, Scope scope, Scanner scanner) throws IOException {
ScannerContext context = scanner.getContext();
DirectoryDescriptor directoryDescriptor = context.getCurrentDescriptor();
PackageDescriptor descriptor = context.getStore().addDescriptorType(directoryDescriptor, PackageDescriptor.class);
String packageName = path.substring(1).replaceAll("/", ".");
String name;
int separatorIndex = packageName.lastIndexOf('.');
if (separatorIndex != -1) {
name = packageName.substring(separatorIndex + 1);
} else {
name = packageName;
}
descriptor.setName(name);
descriptor.setFullQualifiedName(packageName);
return descriptor;
}
Aggregations