private static JavaType lookupTargetType(
final ClassOrInterfaceTypeDetails annotatedType,
final JavaType classBasedAnnotationType,
final JavaType stringBasedAnnotationType) {
final AnnotationMetadata stringBasedAnnotation = annotatedType
.getAnnotation(stringBasedAnnotationType);
if (stringBasedAnnotation != null) {
final AnnotationAttributeValue<String> targetTypeAttributeValue = stringBasedAnnotation
.getAttribute("value");
if (targetTypeAttributeValue != null) {
return new JavaType(targetTypeAttributeValue.getValue());
}
}
final AnnotationMetadata classBasedAnnotation = annotatedType
.getAnnotation(classBasedAnnotationType);
if (classBasedAnnotation != null) {
final AnnotationAttributeValue<JavaType> targetTypeAttributeValue = classBasedAnnotation
.getAttribute("value");
if (targetTypeAttributeValue != null) {
return targetTypeAttributeValue.getValue();
}
}