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
AbstractColumnDescriptor
implementation 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 boolean
isDocumentIDColumn(java.lang.String expr)
Checks if the column is a document id column (starts with &).protected boolean
isSpecialColumn(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 matchingAbstractColumnDescriptor
an returns them.java.util.List<AbstractColumnDescriptor>
translateColumnDescriptors(HeaderDescriptor header, java.util.List<java.lang.String> columnExpressions, boolean rethrowException)
protected AbstractColumnDescriptor
translatorColumnDescriptor(HeaderDescriptor header, java.lang.String expr, int pos)
Instantiates the correctAbstractColumnDescriptor
for 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 matchingAbstractColumnDescriptor
an 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
AbstractColumnDescriptor
s - 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 correctAbstractColumnDescriptor
for the given column expression. Selection is based whether a expression is a- a special column
- a document id column
- a plain column
AbstractColumnDescriptor
if translator is inservicelayer mode
or 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
AbstractColumnDescriptor
to 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
AbstractColumnDescriptor
s
-
-