Field[] fields = fields(clazz);
for (Field field : fields) {
if (log().isTraceEnabled()) {
log().trace(" Scanning field '" + field.getName() + "'");
}
Property property = (Property) field.getAnnotation(Property.class);
if (property != null) {
if (log().isDebugEnabled()) {
log().debug(" Field '" + field.getName() + "' has a @Property annotation");
}
ManagedPropertyConfig mpc = new ManagedPropertyConfig();
String name = property.name();
if ((name == null) || "".equals(name)) {
name = field.getName();
}
mpc.setName(name);
mpc.setType(field.getType().getName()); // FIXME - primitives, arrays, etc.
mpc.setValue(property.value());
mbc.addProperty(mpc);
continue;
}
// Support deprecated @Value annotation as well
Value value = (Value) field.getAnnotation(Value.class);