Class AbstractColumnDescriptor

    • Constructor Detail

      • AbstractColumnDescriptor

        public AbstractColumnDescriptor​(int position,
                                        HeaderDescriptor header,
                                        java.lang.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,
                                        java.lang.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 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 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​(java.lang.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 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 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
      • getQualifierForComment

        public java.lang.String getQualifierForComment()