use of org.jdbi.v3.sqlobject.config.RegisterCollectorFactory in project jdbi by jdbi.
the class RegisterCollectorFactoryImpl method configureForType.
@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
RegisterCollectorFactory registerCollectorFactory = (RegisterCollectorFactory) annotation;
JdbiCollectors collectors = registry.get(JdbiCollectors.class);
Class<? extends CollectorFactory> type = registerCollectorFactory.value();
try {
collectors.register(type.newInstance());
} catch (InstantiationException | IllegalAccessException e) {
throw new IllegalStateException("Unable to instantiate container factory", e);
}
}
Aggregations