Class DefaultImportValidator

java.lang.Object
com.broadleafcommerce.dataimport.service.DefaultImportValidator
All Implemented Interfaces:
ImportValidator

public class DefaultImportValidator extends Object implements ImportValidator
Author:
Phillip Verheyden (phillipuniverse)
  • Constructor Details

    • DefaultImportValidator

      public DefaultImportValidator(long validationFailureLimit)
  • Method Details

    • canValidate

      public boolean canValidate(ImportRequest request)
      Description copied from interface: ImportValidator
      Returns whether this validator can validate the given request.
      Specified by:
      canValidate in interface ImportValidator
      Parameters:
      request - metadata about the import request
      Returns:
      true if this validator can validate the given request, false otherwise
    • validate

      Description copied from interface: ImportValidator
      Validates the file and import request to confirm they meet the basic requirements for allowing persistence and processing of this import.
      Specified by:
      validate in interface ImportValidator
      Returns:
      a detailed response describing any validation errors that were found
    • validateRecords

      protected List<LineError> validateRecords(ImportValidationContext<? extends FileReaderContext> context)
      Iterates through all of the records, returning a list of all validation errors that were encountered.

      There may be more than one LineError returned for a record if there were multiple errors found.

      Parameters:
      context - information about the current import being processed