Java Generic Type and Reflection
- by Tom Tucker
I have some tricky generic type problem involving reflection. Here's the code.
public @interface MyConstraint {
Class<? extends MyConstraintValidator<?>> validatedBy();
}
public interface MyConstraintValidator<T extends Annotation> {
void initialize(T annotation);
}
/**
@param annotation is annotated with…