use of org.broadleafcommerce.openadmin.server.dao.provider.metadata.request.AddMetadataFromMappingDataRequest in project BroadleafCommerce by BroadleafCommerce.
the class Metadata method getFieldMetadata.
public FieldMetadata getFieldMetadata(String prefix, final String propertyName, final List<Property> componentProperties, final SupportedFieldType type, final SupportedFieldType secondaryType, final Type entityType, Class<?> targetClass, final FieldMetadata presentationAttribute, final MergedPropertyType mergedPropertyType, final DynamicEntityDao dynamicEntityDao) {
if (presentationAttribute.getTargetClass() == null) {
presentationAttribute.setTargetClass(targetClass.getName());
presentationAttribute.setFieldName(propertyName);
}
presentationAttribute.setInheritedFromType(targetClass.getName());
presentationAttribute.setAvailableToTypes(new String[] { targetClass.getName() });
boolean handled = false;
for (FieldMetadataProvider fieldMetadataProvider : fieldMetadataProviders) {
MetadataProviderResponse response = fieldMetadataProvider.addMetadataFromMappingData(new AddMetadataFromMappingDataRequest(componentProperties, type, secondaryType, entityType, propertyName, mergedPropertyType, dynamicEntityDao), presentationAttribute);
if (MetadataProviderResponse.NOT_HANDLED != response) {
handled = true;
}
if (MetadataProviderResponse.HANDLED_BREAK == response) {
break;
}
}
if (!handled) {
defaultFieldMetadataProvider.addMetadataFromMappingData(new AddMetadataFromMappingDataRequest(componentProperties, type, secondaryType, entityType, propertyName, mergedPropertyType, dynamicEntityDao), presentationAttribute);
}
return presentationAttribute;
}
Aggregations