Class AbstractColumnDescriptor
- java.lang.Object
-
- de.hybris.platform.impex.jalo.header.AbstractDescriptor
-
- de.hybris.platform.impex.jalo.header.AbstractColumnDescriptor
-
- Direct Known Subclasses:
DocumentIDColumnDescriptor,SpecialColumnDescriptor,StandardColumnDescriptor
public abstract class AbstractColumnDescriptor extends AbstractDescriptor
Represents a descriptor of a column. A column holds the header instance it belongs to, the position within this header as well as a cell decorator additionally to the instances hold by a general descriptor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.impex.jalo.header.AbstractDescriptor
AbstractDescriptor.ColumnParams, AbstractDescriptor.DescriptorParams, AbstractDescriptor.HeaderParams
-
-
Constructor Summary
Constructors Constructor Description AbstractColumnDescriptor(int position, HeaderDescriptor header, java.lang.String expr)Self-parsing constructor.AbstractColumnDescriptor(int position, HeaderDescriptor header, java.lang.String expr, AbstractDescriptor.DescriptorParams params)Non-parsing constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidchangePosition(int newPos)Assigns this column a new value position.protected CSVCellDecoratorcreateCSVDecorator()Evaluates thecellDecoratormodifier and instantiates the specified class if set.protected HeaderCellTranslatorcreateTranslator(java.lang.String expr)Creates the translator class which parses the own definition text of this descriptor.CSVCellDecoratorgetCSVCellDecorator()Gets the cell decorator instance specified for this column.HeaderDescriptorgetHeader()Gets the header instance this column belongs to.java.lang.StringgetQualifier()Gets the qualifier of this column without prefix (If the qualifier is "Principal.uid", only "uid" will be returned, all until the first dot will be cut).java.lang.StringgetQualifierForComment()intgetValuePosition()Gets the position of this column within header.protected voidshiftPosition(int offset)Shifts this column to the right by the given offset.protected voidvalidate()-
Methods inherited from class de.hybris.platform.impex.jalo.header.AbstractDescriptor
extractItemPathElements, extractModifiersMap, getDefinitionSrc, getDescriptorData, getDescriptorTranslator, parseColumnDescriptor, parseHeaderDescriptor
-
-
-
-
Constructor Detail
-
AbstractColumnDescriptor
public AbstractColumnDescriptor(int position, HeaderDescriptor header, java.lang.String expr) throws HeaderValidationExceptionSelf-parsing constructor. Creates a new column descriptor belonging to given header, creates fitting translator and parses all column parameters from given expression.- Parameters:
position- position of column within headerheader- the header the column belongsexpr- column expression- Throws:
HeaderValidationException- error while parsing column expression
-
AbstractColumnDescriptor
public AbstractColumnDescriptor(int position, HeaderDescriptor header, java.lang.String expr, AbstractDescriptor.DescriptorParams params) throws HeaderValidationExceptionNon-parsing constructor. Creates a new column descriptor belonging to given header using given column parameters.- Parameters:
position- position of column within headerheader- the header the column belongsexpr- column expressionparams- already parsed column parameters- Throws:
HeaderValidationException- error while processing column expression
-
-
Method Detail
-
changePosition
protected void changePosition(int newPos)
Assigns this column a new value position.- Parameters:
newPos- the new position of the column
-
shiftPosition
protected void shiftPosition(int offset)
Shifts this column to the right by the given offset.pos += offset
- Parameters:
offset- the offset which will be add to the position
-
createCSVDecorator
protected CSVCellDecorator createCSVDecorator() throws HeaderValidationException
Evaluates thecellDecoratormodifier and instantiates the specified class if set.- Returns:
- the cell decorator class specified at modifier of this column
- Throws:
HeaderValidationException- specified class is not of correct type
-
getCSVCellDecorator
public CSVCellDecorator getCSVCellDecorator()
Gets the cell decorator instance specified for this column.- Returns:
- assigned cell decorator
-
createTranslator
protected HeaderCellTranslator createTranslator(java.lang.String expr)
Description copied from class:AbstractDescriptorCreates the translator class which parses the own definition text of this descriptor.- Specified by:
createTranslatorin classAbstractDescriptor- Parameters:
expr- the definition text- Returns:
- the translator instance
-
getQualifier
public java.lang.String getQualifier()
Gets the qualifier of this column without prefix (If the qualifier is "Principal.uid", only "uid" will be returned, all until the first dot will be cut).- Returns:
- qualifier of this column
-
getValuePosition
public int getValuePosition()
Gets the position of this column within header. It may not be the original position because of calls of thechangePosition(int)orshiftPosition(int)methods.- Returns:
- position of column within header
-
getHeader
public HeaderDescriptor getHeader()
Gets the header instance this column belongs to.- Returns:
- mapped header
-
validate
protected void validate() throws HeaderValidationException- Specified by:
validatein classAbstractDescriptor- Throws:
HeaderValidationException
-
getQualifierForComment
public java.lang.String getQualifierForComment()
-
-