Search in sources :

Example 1 with ConfiguringAnnotation

use of org.jdbi.v3.sqlobject.config.ConfiguringAnnotation in project jdbi by jdbi.

the class SqlObjectFactory method forEachConfigurer.

private void forEachConfigurer(AnnotatedElement element, BiConsumer<Configurer, Annotation> consumer) {
    Stream.of(element.getAnnotations()).filter(a -> a.annotationType().isAnnotationPresent(ConfiguringAnnotation.class)).forEach(a -> {
        ConfiguringAnnotation meta = a.annotationType().getAnnotation(ConfiguringAnnotation.class);
        consumer.accept(getConfigurer(meta.value()), a);
    });
}
Also used : ExtensionMethod(org.jdbi.v3.core.extension.ExtensionMethod) HandleSupplier(org.jdbi.v3.core.extension.HandleSupplier) Arrays(java.util.Arrays) Proxy(java.lang.reflect.Proxy) ConfiguringAnnotation(org.jdbi.v3.sqlobject.config.ConfiguringAnnotation) HashMap(java.util.HashMap) ConfigRegistry(org.jdbi.v3.core.config.ConfigRegistry) Stream(java.util.stream.Stream) Collections.synchronizedMap(java.util.Collections.synchronizedMap) Map(java.util.Map) Annotation(java.lang.annotation.Annotation) BiConsumer(java.util.function.BiConsumer) ExtensionFactory(org.jdbi.v3.core.extension.ExtensionFactory) InvocationHandler(java.lang.reflect.InvocationHandler) Configurer(org.jdbi.v3.sqlobject.config.Configurer) Method(java.lang.reflect.Method) Collections(java.util.Collections) WeakHashMap(java.util.WeakHashMap) AnnotatedElement(java.lang.reflect.AnnotatedElement) ConfiguringAnnotation(org.jdbi.v3.sqlobject.config.ConfiguringAnnotation)

Aggregations

Annotation (java.lang.annotation.Annotation)1 AnnotatedElement (java.lang.reflect.AnnotatedElement)1 InvocationHandler (java.lang.reflect.InvocationHandler)1 Method (java.lang.reflect.Method)1 Proxy (java.lang.reflect.Proxy)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 Collections.synchronizedMap (java.util.Collections.synchronizedMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 WeakHashMap (java.util.WeakHashMap)1 BiConsumer (java.util.function.BiConsumer)1 Stream (java.util.stream.Stream)1 ConfigRegistry (org.jdbi.v3.core.config.ConfigRegistry)1 ExtensionFactory (org.jdbi.v3.core.extension.ExtensionFactory)1 ExtensionMethod (org.jdbi.v3.core.extension.ExtensionMethod)1 HandleSupplier (org.jdbi.v3.core.extension.HandleSupplier)1 Configurer (org.jdbi.v3.sqlobject.config.Configurer)1 ConfiguringAnnotation (org.jdbi.v3.sqlobject.config.ConfiguringAnnotation)1