Map<String, FieldMetadata> attributes = new HashMap<String, FieldMetadata>();
Field[] fields = dynamicEntityDao.getAllFields(targetClass);
for (Field field : fields) {
boolean foundOneOrMoreHandlers = false;
for (FieldMetadataProvider fieldMetadataProvider : fieldMetadataProviders) {
FieldProviderResponse response = fieldMetadataProvider.addMetadata(new AddMetadataRequest(field, parentClass, targetClass,
dynamicEntityDao, prefix), attributes);
if (FieldProviderResponse.NOT_HANDLED != response) {
foundOneOrMoreHandlers = true;
}
if (FieldProviderResponse.HANDLED_BREAK == response) {
break;
}
}
if (!foundOneOrMoreHandlers) {
defaultFieldMetadataProvider.addMetadata(new AddMetadataRequest(field, parentClass, targetClass,
dynamicEntityDao, prefix), attributes);
}
}
return attributes;
}