private Reflections reflections;
public AutoConfig(String... basePackages) {
Preconditions.checkArgument(basePackages.length > 0);
ConfigurationBuilder cfgBldr = new ConfigurationBuilder();
FilterBuilder filterBuilder = new FilterBuilder();
for (String basePkg : basePackages) {
cfgBldr.addUrls(ClasspathHelper.forPackage(basePkg));
filterBuilder.include(FilterBuilder.prefix(basePkg));
}
cfgBldr.filterInputsBy(filterBuilder).setScanners(
new SubTypesScanner(), new TypeAnnotationsScanner());
this.reflections = new Reflections(cfgBldr);
}