Class CollectedProductJsonArrayToCommerceManagerFeedCSVFileTransformer
java.lang.Object
com.broadleafcommerce.datafeed.service.publisher.file.transformer.AbstractJsonArrayToCSVFileTransformer<CollectedProduct,CommerceManagerFeedCSVProduct>
com.broadleafcommerce.datafeed.feedprovider.meta.api.publisher.file.CollectedProductJsonArrayToCommerceManagerFeedCSVFileTransformer
- All Implemented Interfaces:
DataFeedFileTransformer,org.springframework.core.Ordered
public class CollectedProductJsonArrayToCommerceManagerFeedCSVFileTransformer
extends AbstractJsonArrayToCSVFileTransformer<CollectedProduct,CommerceManagerFeedCSVProduct>
implements DataFeedFileTransformer
DataFeedFileTransformer for transforming a source JSON array of CollectedProduct
into a CSV containing CommerceManagerFeedCSVProduct.-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionCollectedProductJsonArrayToCommerceManagerFeedCSVFileTransformer(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, DataFeedElementTransformer<CollectedProduct, CommerceManagerFeedCSVProduct> elementTransformer, int maxSourceElementsToReadInBatch) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(DataFeedPublishRequestDetails requestDetails) Reports whether this component can handle processing a file transformation for the givenDataFeedPublishRequestDetails.createLocalOutputFile(DataFeedPublishRequestDetails publishRequest) Create the local output file that will ultimately be populated byDataFeedFileTransformer.transform(FilePublishContext).Methods inherited from class com.broadleafcommerce.datafeed.service.publisher.file.transformer.AbstractJsonArrayToCSVFileTransformer
buildCsvMapper, buildCsvSchema, buildFailedResponse, buildSuccessResponse, getElementTransformer, getMaxSourceElementsToReadInBatch, getObjectMapper, getTypeFactory, transformMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.datafeed.service.publisher.file.transformer.DataFeedFileTransformer
getOrder, transform
-
Constructor Details
-
CollectedProductJsonArrayToCommerceManagerFeedCSVFileTransformer
public CollectedProductJsonArrayToCommerceManagerFeedCSVFileTransformer(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, DataFeedElementTransformer<CollectedProduct, CommerceManagerFeedCSVProduct> elementTransformer, int maxSourceElementsToReadInBatch)
-
-
Method Details
-
canHandle
Description copied from interface:DataFeedFileTransformerReports whether this component can handle processing a file transformation for the givenDataFeedPublishRequestDetails.- Specified by:
canHandlein interfaceDataFeedFileTransformer- Parameters:
requestDetails- request details around the publish process- Returns:
- true if this component can handle the transformation for the given file, false otherwise
-
createLocalOutputFile
Description copied from interface:DataFeedFileTransformerCreate the local output file that will ultimately be populated byDataFeedFileTransformer.transform(FilePublishContext).In almost all cases, this should point to a temporary file (ex:
Files.createTempFile(String, String, FileAttribute[]))Note that this method is intentionally simple and is not intended to be a place where file contents are initialized.
Since this is the file that will ultimately be uploaded to the destination, ensure it has the appropriate file name/extensions required by the provider.
- Specified by:
createLocalOutputFilein interfaceDataFeedFileTransformer- Parameters:
publishRequest- the publish request details- Returns:
- a reference to the created file
- Throws:
Exception- if something went wrong- See Also:
-