public class ExcelValidationResultUtil
extends java.lang.Object
ExcelValidationResult contains results
which belong to the same rows, then such ExcelValidationResult are merged - all messages are put to one
ExcelValidationResult and common validation header is created. This class also adds appropriate headers and
metadata to excel validation result if needed.| Modifier and Type | Method and Description |
|---|---|
static void |
insertHeaderIfNeeded(ExcelValidationResult singleResult,
int rowIndex,
java.lang.String typeCode,
java.lang.String attributeName)
Creates validation header if given
ExcelValidationResult does not have it. |
static java.util.Collection<ValidationMessage> |
mapExcelResultsToValidationMessages(java.util.Collection<ExcelValidationResult> results)
Allows to retrieve all
ValidationMessages from given ExcelValidationResults and returns the flat
structure. |
static ExcelValidationResult |
mergeExcelValidationResults(java.util.Collection<ExcelValidationResult> results)
Allows to merge the list of errors from
ExcelValidationResult to single ExcelValidationResult. |
static java.util.List<ExcelValidationResult> |
mergeValidationResults(java.util.List<ExcelValidationResult> resultsToMerge)
Finds
ExcelValidationResult which belong to the same row and creates new ExcelValidationResult which
consists of merged ValidationMessage and common header. |
public static void insertHeaderIfNeeded(ExcelValidationResult singleResult, int rowIndex, java.lang.String typeCode, java.lang.String attributeName)
ExcelValidationResult does not have it. Moreover this methods populates
metadata information about given validation result, for example: rowIndex, typeCode and attribute name.singleResult - rowIndex - typeCode - attributeName - public static java.util.List<ExcelValidationResult> mergeValidationResults(java.util.List<ExcelValidationResult> resultsToMerge)
ExcelValidationResult which belong to the same row and creates new ExcelValidationResult which
consists of merged ValidationMessage and common header. This method returns new merged list of
ExcelValidationResult.resultsToMerge - ExcelValidationResultpublic static ExcelValidationResult mergeExcelValidationResults(java.util.Collection<ExcelValidationResult> results)
ExcelValidationResult to single ExcelValidationResult.results - to mergepublic static java.util.Collection<ValidationMessage> mapExcelResultsToValidationMessages(java.util.Collection<ExcelValidationResult> results)
ValidationMessages from given ExcelValidationResults and returns the flat
structure.results - to mapValidationMessageCopyright © 2018 SAP SE. All Rights Reserved.