@Test public void testGet() throws Exception { Object o = new Object(); Assertions.assertNull(PropUtils.get(o.getClass(), "noClass")); Integer integer = new Integer(42); Assertions.assertNull(PropUtils.get(integer.getClass().getDeclaredField("value"))); TestProp testProp = new TestProp(); Assertions.assertNotNull(PropUtils.get(TestProp.class, "property")); Assertions.assertNull(PropUtils.get(null)); }
public static PropertyInfo get(final Class<?> clazz, final String property) { final Field field = getField(clazz, property); if (field != null) { return field.getAnnotation(PropertyInfo.class); } return null; }
PropUtils { public static PropertyInfo get(final Class<?> clazz, final String property) { final Field field = getField(clazz, property); if (field != null) { return field.getAnnotation(PropertyInfo.class); } return null; } }
PropUtils { public static PropertyInfo get(final Class<?> clazz, final String property) { final Field field = getField(clazz, property); if (field != null) { return field.getAnnotation(PropertyInfo.class); } return null; }  }
PropUtils { public static PropertyInfo get(final Class<?> clazz, final String property) { final Field field = getField(clazz, property); if (field != null) { return field.getAnnotation(PropertyInfo.class); } return null; }  static PropertyInfo get(final Class<?> clazz, final String property); static PropertyInfo get(final Field field); static Field getField(final Class<?> clazz, final String property); static Field getField(final Class<?> clazz, final String property, boolean suppressWarning); static String getI18nKey(final Class<?> clazz, final String property); static Field[] getPropertyInfoFields(final Class<?> clazz); }
PropUtils { public static PropertyInfo get(final Class<?> clazz, final String property) { final Field field = getField(clazz, property); if (field != null) { return field.getAnnotation(PropertyInfo.class); } return null; }  static PropertyInfo get(final Class<?> clazz, final String property); static PropertyInfo get(final Field field); static Field getField(final Class<?> clazz, final String property); static Field getField(final Class<?> clazz, final String property, boolean suppressWarning); static String getI18nKey(final Class<?> clazz, final String property); static Field[] getPropertyInfoFields(final Class<?> clazz);  }