// add fields
while (resourceClass != Object.class) {
for (Field field : resourceClass.getDeclaredFields()) {
Type fieldType = field.getGenericType();
Injectable injectable = parseAccessibleObject(field, fieldType);
if (injectable != null) {
injectableFields.add(injectable);
}
}
resourceClass = resourceClass.getSuperclass();
}
// add properties
PropertyDescriptor[] propertyDescriptors = metadata.getBeanInfo().getPropertyDescriptors();
if (propertyDescriptors != null) {
l: for (PropertyDescriptor pd : propertyDescriptors) {
Method writeMethod = pd.getWriteMethod();
if (writeMethod == null) {
// the property cannot be written, ignore it.
continue l;
}
Type genericReturnType = writeMethod.getParameterTypes()[0];
Injectable injectable = parseAccessibleObject(writeMethod, genericReturnType);
if (injectable != null) {
injectableFields.add(injectable);
}
}
}