Class AbstractTypeTranslator
java.lang.Object
de.hybris.platform.impex.jalo.translators.AbstractTypeTranslator
- All Implemented Interfaces:
HeaderCellTranslator
- Direct Known Subclasses:
DefaultTypeTranslator
Base class for all TypeTranslators. Validates and translates ImpEx cell headers.
Returns a AbstractColumnDescriptor implementation for a specific HeaderDescriptor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<AbstractColumnDescriptor>Generates all mandatory column expressions related to the given header.protected booleanisDocumentIDColumn(String expr) Checks if the column is a document id column (starts with &).protected booleanisSpecialColumn(String expr) Checks if the column is a special column (starts with @).translateColumnDescriptors(HeaderDescriptor header, List<String> columnExpressions) Instantiates for each column expression in given list the matchingAbstractColumnDescriptoran returns them.translateColumnDescriptors(HeaderDescriptor header, List<String> columnExpressions, boolean rethrowException) protected AbstractColumnDescriptortranslatorColumnDescriptor(HeaderDescriptor header, String expr, int pos) Instantiates the correctAbstractColumnDescriptorfor the given column expression.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.impex.jalo.translators.HeaderCellTranslator
isValid, translate
-
Constructor Details
-
AbstractTypeTranslator
public AbstractTypeTranslator()
-
-
Method Details
-
translateColumnDescriptors
public List<AbstractColumnDescriptor> translateColumnDescriptors(HeaderDescriptor header, List<String> columnExpressions) throws HeaderValidationException Instantiates for each column expression in given list the matchingAbstractColumnDescriptoran returns them.- Parameters:
header- the current header object to which the columns belongcolumnExpressions- the column expression for which column descriptors will be instantiated- Returns:
- list of
AbstractColumnDescriptors - Throws:
HeaderValidationException- no column expressions are declared and header is not in relaxed mode
-
translateColumnDescriptors
public List<AbstractColumnDescriptor> translateColumnDescriptors(HeaderDescriptor header, List<String> columnExpressions, boolean rethrowException) throws HeaderValidationException - Throws:
HeaderValidationException
-
translatorColumnDescriptor
protected AbstractColumnDescriptor translatorColumnDescriptor(HeaderDescriptor header, String expr, int pos) throws HeaderValidationException Instantiates the correctAbstractColumnDescriptorfor the given column expression. Selection is based whether a expression is a- a special column
- a document id column
- a plain column
AbstractColumnDescriptorif translator is inservicelayer modeor not.- Parameters:
header- the header to which the column belongsexpr- the column expression to which a descriptor is neededpos- the position of the column within the header- Returns:
- a
AbstractColumnDescriptorto the given column expression - Throws:
HeaderValidationException- exception while instantiation
-
isSpecialColumn
Checks if the column is a special column (starts with @).- Parameters:
expr- the column string- Returns:
- true if the string is a special column
-
isDocumentIDColumn
Checks if the column is a document id column (starts with &).- Parameters:
expr- the column string- Returns:
- true if the string is a column defining a document id
-
getAutoColumnExpressions
Generates all mandatory column expressions related to the given header.- Parameters:
header- the header for which columns are needed- Returns:
- list of
AbstractColumnDescriptors
-