I've something like the following:
public class ValidationModule extends AbstractModule {
@Override
protected void configure() {
Multibinder<Validator> validatorMultibinder = Multibinder.newSetBinder(binder(),
Validator.class, Names.named("mainValidators"));
validatorMultibinder.addBinding().to(FirstValidator.class);
validatorMultibinder.addBinding().to(SecondValidator.class);
}
}
I'm a newbie to google/guice and I would like to understand the order of these validator validate function will be executed. Are they going to run from top to bottom or the opposite?
After running the module in the application I have found that the object that I bounded to "mainValidators" was holding the classes in the order from top to bottom. So when I iterated over them they were in the following order.