final GuiceModuleHandler guiceModuleHandler = new GuiceModuleHandler();
final GuiceInjectableClassHandler<Inject> guiceInjectableClassHandler = new GuiceInjectableClassHandler<Inject>();
final GuiceInjectableClassHandler<javax.inject.Inject> jsr330InjectableClassHandler = new GuiceInjectableClassHandler<javax.inject.Inject>();
final MockHandler mockHandler = new MockHandler();
final MockFrameworkHandler mockFrameworkHandler = new MockFrameworkHandler();
// Visit class and super-classes
new ClassVisitor()
.registerHandler( GuiceProvidedModules.class, guiceProvidedModuleHandler )
.registerHandler( GuiceModules.class, guiceModuleHandler )
.registerHandler( Mock.class, mockHandler )
.registerHandler( MockFramework.class, mockFrameworkHandler )
.registerHandler( Inject.class, guiceInjectableClassHandler )
.registerHandler( javax.inject.Inject.class, jsr330InjectableClassHandler )
.visit( clazz );
// Retrieve mock framework
if ( mockFrameworkHandler.getMockType() != null )
{
this.mockFramework = mockFrameworkHandler.getMockType();
}
// retrieve the modules founded
allModules.addAll( guiceProvidedModuleHandler.getModules() );
allModules.addAll( guiceModuleHandler.getModules() );