Interface SpreadsheetSingleSheetValidatorDelegate

All Known Implementing Classes:
DefaultSpreadsheetSingleSheetValidatorDelegate

public interface SpreadsheetSingleSheetValidatorDelegate
The interface provides the custom validation hook for validating at individual sheet level and at row level of any sheet. The implementation must extend this interface for adding custom validations at sheet level or at row level. The @DefaultSpreadsheetSingleSheetValidatorDelegate provides default implementation which can be extended for further use. Custom warnings or exceptions thrown from custom validation logic should adhere to pattern mentioned in DefaultSpreadsheetSingleSheetValidatorDelegate They should add warnings or exceptions to single list with all details, which will be returned by API getErrorsOrWarnings().

Supported API: true

Extendable: true
  • Method Details

    • validateFieldsForSheetWithAllRowElements

      void validateFieldsForSheetWithAllRowElements(String sheetName, Map<String,Map> allRowsMap, Locale locale) throws WTException
      This method provides the custom validation for the entire sheet. The specifics of validation is left to customer's implementation where customer will have access to entire sheet and group of all rows present in given sheet.

      Supported API: true
      Parameters:
      sheetName - Name of current sheet being imported
      allRowsMap - Map representing Key as rowNumber and value as RowData (which is map again to present row information in key value pair where key is attribute name and value is value in cell)
      locale - Locale to display or generate localized error or warning messages
      Throws:
      WTException
    • validateFieldsForSingleRow

      void validateFieldsForSingleRow(String sheetName, String rowNumber, Map rowData, Locale locale) throws WTException
      This method provides the custom validation for the single given row. The specifics of validation is left to customer's implementation where customer will have access to given row in given sheet.

      Supported API: true
      Parameters:
      sheetName - Name of current sheet being imported
      rowNumber - row Number of given row being validated
      rowData - map to present row information in key value pair where key is attribute name and value is value in cell
      locale - Locale to display or generate localized error or warning messages
      Throws:
      WTException
    • getErrorsOrWarnings

      List<WTException> getErrorsOrWarnings()
      This method returns list of custom warnings or exceptions thrown by custom logic during validations. Custom implementation should override this API to return warnings or exceptions to be shown on Import from Spreadsheet UI.

      Supported API: true
      Returns:
      List List of exceptions/warnings thrown from custom logic, to be returned to ImportService
      Throws:
      WTException