Class AbstractTypeTranslator
- java.lang.Object
-
- de.hybris.platform.impex.jalo.translators.AbstractTypeTranslator
-
- All Implemented Interfaces:
HeaderCellTranslator
- Direct Known Subclasses:
DefaultTypeTranslator
public abstract class AbstractTypeTranslator extends java.lang.Object implements HeaderCellTranslator
Base class for all TypeTranslators. Validates and translates ImpEx cell headers.Returns a
AbstractColumnDescriptorimplementation for a specificHeaderDescriptor
-
-
Constructor Summary
Constructors Constructor Description AbstractTypeTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<AbstractColumnDescriptor>getAutoColumnExpressions(HeaderDescriptor header)Generates all mandatory column expressions related to the given header.protected booleanisDocumentIDColumn(java.lang.String expr)Checks if the column is a document id column (starts with &).protected booleanisSpecialColumn(java.lang.String expr)Checks if the column is a special column (starts with @).java.util.List<AbstractColumnDescriptor>translateColumnDescriptors(HeaderDescriptor header, java.util.List<java.lang.String> columnExpressions)Instantiates for each column expression in given list the matchingAbstractColumnDescriptoran returns them.java.util.List<AbstractColumnDescriptor>translateColumnDescriptors(HeaderDescriptor header, java.util.List<java.lang.String> columnExpressions, boolean rethrowException)protected AbstractColumnDescriptortranslatorColumnDescriptor(HeaderDescriptor header, java.lang.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, wait
-
Methods inherited from interface de.hybris.platform.impex.jalo.translators.HeaderCellTranslator
isValid, translate
-
-
-
-
Method Detail
-
translateColumnDescriptors
public java.util.List<AbstractColumnDescriptor> translateColumnDescriptors(HeaderDescriptor header, java.util.List<java.lang.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 java.util.List<AbstractColumnDescriptor> translateColumnDescriptors(HeaderDescriptor header, java.util.List<java.lang.String> columnExpressions, boolean rethrowException) throws HeaderValidationException
- Throws:
HeaderValidationException
-
translatorColumnDescriptor
protected AbstractColumnDescriptor translatorColumnDescriptor(HeaderDescriptor header, java.lang.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
protected boolean isSpecialColumn(java.lang.String expr)
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
protected boolean isDocumentIDColumn(java.lang.String expr)
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
protected java.util.List<AbstractColumnDescriptor> getAutoColumnExpressions(HeaderDescriptor header)
Generates all mandatory column expressions related to the given header.- Parameters:
header- the header for which columns are needed- Returns:
- list of
AbstractColumnDescriptors
-
-