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.
  • Constructor Details

    • AbstractColumnDescriptor

      public AbstractColumnDescriptor(int position, HeaderDescriptor header, String expr) throws HeaderValidationException
      Self-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 header
      header - the header the column belongs
      expr - column expression
      Throws:
      HeaderValidationException - error while parsing column expression
    • AbstractColumnDescriptor

      public AbstractColumnDescriptor(int position, HeaderDescriptor header, String expr, AbstractDescriptor.DescriptorParams params) throws HeaderValidationException
      Non-parsing constructor. Creates a new column descriptor belonging to given header using given column parameters.
      Parameters:
      position - position of column within header
      header - the header the column belongs
      expr - column expression
      params - already parsed column parameters
      Throws:
      HeaderValidationException - error while processing column expression
  • Method Details

    • 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 the cellDecorator modifier 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(String expr)
      Description copied from class: AbstractDescriptor
      Creates the translator class which parses the own definition text of this descriptor.
      Specified by:
      createTranslator in class AbstractDescriptor
      Parameters:
      expr - the definition text
      Returns:
      the translator instance
    • getQualifier

      public 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 the changePosition(int) or shiftPosition(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:
      validate in class AbstractDescriptor
      Throws:
      HeaderValidationException
    • getQualifierForComment

      public String getQualifierForComment()