private static <A extends Annotation> A getAnnotationOnProperty(PropertyDescriptor propertyDescriptor, Class<?> javaType, Class<A> annotationType) {
    Method setter = propertyDescriptor.getWriteMethod();
    Method getter = propertyDescriptor.getReadMethod();
    if (setter.isAnnotationPresent(annotationType) && getter.isAnnotationPresent(annotationType)) {
      throw new RuntimeException("Annotation " + annotationType.getSimpleName() + " cannot be annotated on both setter and getter method.");
    }
    A annotation = getter.isAnnotationPresent(annotationType) ? getter.getAnnotation(annotationType) : setter.getAnnotation(annotationType);
    if (annotation == null) {
      Field filed = findDeclaredFiled(javaType, propertyDescriptor.getName());
      if (filed != null) {
        if (filed.isAnnotationPresent(annotationType)) {
          annotation = filed.getAnnotation(annotationType);
        }
      }
    }
    return annotation;
  }