*
* @param annotation the annotation
* @return a converter instance or {@code null} if the given annotation is no option annotation
*/
private static <A extends Annotation> AnnotationConverter<A> getConverter(Annotation annotation) {
MappingOption mappingOption = annotation.annotationType().getAnnotation( MappingOption.class );
// wrong type would be a programming error of the annotation developer
@SuppressWarnings("unchecked")
Class<? extends AnnotationConverter<A>> converterClass = (Class<? extends AnnotationConverter<A>>) ( mappingOption != null ? mappingOption.value()
: null );
try {
return converterClass != null ? converterClass.newInstance() : null;
}