I want to know a class\'s some member variable\'s annotations , I use BeanInfo beanInfo = Introspector.getBeanInfo(User.class) to introspect a class , and use <
You can get annotations on the getter method:
propertyDescriptor.getReadMethod().getDeclaredAnnotations();
Getting the annotations of a private field seems like a bad idea... what if the property isn't even backed by a field, or is backed by a field with a different name? Even ignoring those cases, you're breaking abstraction by looking at private stuff.