AnnotationInvocationHandler(final Class<? extends Annotation> annotationClass, final AnnotationInfo annotationInfo) { this.annotationClass = annotationClass; this.toString = annotationInfo.toString(); // Instantiate the annotation parameter values (this loads and gets references for class literals, // enum constants, etc.) for (final AnnotationParameterValue apv : annotationInfo.getParameterValues()) { final Object instantiatedValue = apv.instantiate(annotationInfo.getClassInfo()); if (instantiatedValue == null) { // Annotations cannot contain null values throw new IllegalArgumentException("Got null value for annotation parameter " + apv.getName() + " of annotation " + annotationInfo.getName()); } this.annotationParameterValuesInstantiated.put(apv.getName(), instantiatedValue); } }