List<Module> modules = new ArrayList<Module>(0);
modules.add(new Module() {
@Override
public void configure(Binder binder) {
Field[] fields;
JndiResource annotation;
Class type;
Class<JndiResource> _clazz = JndiResource.class;
for (Class<?> clazz : classes) {
fields = clazz.getDeclaredFields();
for(Field f: fields){
if(f.isAnnotationPresent(_clazz)){
annotation = f.getAnnotation(_clazz);
type = f.getType();
binder.bind(type).annotatedWith(_clazz).toProvider(JndiProvider.fromJndi(type,annotation.jndi()));
}
}
}
}
});