use of org.broadleafcommerce.openadmin.server.dao.provider.metadata.request.AddFieldMetadataRequest in project BroadleafCommerce by BroadleafCommerce.
the class Metadata method getFieldMetadataForTargetClass.
public Map<String, FieldMetadata> getFieldMetadataForTargetClass(Class<?> parentClass, Class<?> targetClass, DynamicEntityDao dynamicEntityDao, String prefix) {
Map<String, FieldMetadata> metadata = new HashMap<>();
Field[] fields = dynamicEntityDao.getAllFields(targetClass);
for (Field field : fields) {
boolean foundOneOrMoreHandlers = false;
for (FieldMetadataProvider fieldMetadataProvider : fieldMetadataProviders) {
MetadataProviderResponse response = fieldMetadataProvider.addMetadata(new AddFieldMetadataRequest(field, parentClass, targetClass, dynamicEntityDao, prefix), metadata);
if (MetadataProviderResponse.NOT_HANDLED != response) {
foundOneOrMoreHandlers = true;
}
if (MetadataProviderResponse.HANDLED_BREAK == response) {
break;
}
}
if (!foundOneOrMoreHandlers) {
defaultFieldMetadataProvider.addMetadata(new AddFieldMetadataRequest(field, parentClass, targetClass, dynamicEntityDao, prefix), metadata);
}
}
return metadata;
}
Aggregations