Class AbstractValidationAwareTranslator<T>
java.lang.Object
com.hybris.backoffice.excel.translators.AbstractValidationAwareTranslator<T>
- Type Parameters:
T- - class which should be handled by translator
- All Implemented Interfaces:
ExcelValueTranslator<T>,org.springframework.core.Ordered
- Direct Known Subclasses:
AbstractExcelValueTranslator,ExcelGenericReferenceTranslator
public abstract class AbstractValidationAwareTranslator<T>
extends Object
implements ExcelValueTranslator<T>
Abstract class for translator which can have validators.
-
Field Summary
FieldsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns list of validators for current translator.voidsetValidators(List<ExcelValidator> validators) Sets list of validators for current translator.validate(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor, Map<String, Object> context) Validates single cell based on parsed importParameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hybris.backoffice.excel.translators.ExcelValueTranslator
canHandle, canHandle, exportData, exportData, importData, referenceFormatMethods inherited from interface org.springframework.core.Ordered
getOrder
-
Field Details
-
validators
-
-
Constructor Details
-
AbstractValidationAwareTranslator
public AbstractValidationAwareTranslator()
-
-
Method Details
-
validate
public ExcelValidationResult validate(ImportParameters importParameters, AttributeDescriptorModel attributeDescriptor, Map<String, Object> context) Description copied from interface:ExcelValueTranslatorValidates single cell based on parsed importParameters. If cell has reference format then parsed values are available inImportParameters.parameters. Otherwise the value of cell can be obtained byImportParameters.cellValue.- Specified by:
validatein interfaceExcelValueTranslator<T>- Parameters:
importParameters- - contains information about parsed cell value (for reference format)ImportParameters.parametersand original cell valueImportParameters.cellValueattributeDescriptor- - contains information about selected attribute for current cellcontext- - shared context which can be used as a cache- Returns:
- - validation result
-
getValidators
Returns list of validators for current translator.- Returns:
- list of validators for current translator.
-
setValidators
Sets list of validators for current translator.- Parameters:
validators- list of validators for current translator.
-