package ch.jalu.injector.annotationhandlers;

import javax.annotation.Nullable;
import java.lang.annotation.Annotation;

/**
 * .
 */
public abstract class TypeSafeAnnotationHandler<T extends Annotation> implements AnnotationHandler {

    @Override
    public final Object resolveValue(Annotation... annotations) {
        final Class<T> type = getAnnotationType();
        for (Annotation annotation : annotations) {
            if (type.isInstance(annotation)) {
                return resolveValueSafely(type.cast(annotation));
            }
        }
        return null;
    }

    protected abstract Class<T> getAnnotationType();

    @Nullable
    protected abstract Object resolveValueSafely(T annotation);
}

@@ -121,16 +121,139 @@
 %0A/**%0A * 
+Type safe annotation handler base, which will fire the resolve method only if%0A * an annotation of the given type is present
 .%0A */%0Apu
@@ -403,16 +403,32 @@
 veValue(
+Class%3C?%3E clazz, 
 Annotati
@@ -437,32 +437,49 @@
 ... annotations)
+ throws Exception
  %7B%0A        final
@@ -657,16 +657,23 @@
 eSafely(
+clazz, 
 type.cas
@@ -748,57 +748,442 @@
     
-protected abstract Class%3CT%3E getAnnotationType();%0A
+/**%0A     * Returns the class of the annotation the handler can process.%0A     *%0A     * @return the annotation type%0A     */%0A    protected abstract Class%3CT%3E getAnnotationType();%0A%0A    /**%0A     * Resolves the value with the matched annotation, guaranteed to never be null.%0A     *%0A     * @param clazz the dependency's type%0A     * @param annotation the matched annotation%0A     * @return the resolved value, or null if none applicable%0A     */
 %0A   
@@ -1246,21 +1246,53 @@
 ely(
-T annotation)
+Class%3C?%3E clazz, T annotation) throws Exception
 ;%0A%7D
-%0A

Revert code changes from bea7cd1