Class DataTableBindHelper


  • public class DataTableBindHelper
    extends Object
    • Field Detail

      • COLLECTION_ACCESS_BY_INDEX_PATTERN

        public static final Pattern COLLECTION_ACCESS_BY_INDEX_PATTERN
      • COLLECTION_ACCESS_BY_KEY_PATTERN

        public static final Pattern COLLECTION_ACCESS_BY_KEY_PATTERN
      • PRECISION_PATTERN

        public static final Pattern PRECISION_PATTERN
      • SPREADSHEETRESULT_FIELD_PATTERN

        public static final Pattern SPREADSHEETRESULT_FIELD_PATTERN
    • Method Detail

      • hasForeignKeysRow

        public static boolean hasForeignKeysRow​(ILogicalTable dataTable)
        Foreign keys row is optional for data table. It consists reference for field value to other table. Foreign keys always starts from 62 symbol.
        Parameters:
        dataTable - data table to check
        Returns:
        TRUE if second row in data table body (next to the field row) consists even one value, in any column, starts with 62 symbol.
      • getTableBody

        public static ILogicalTable getTableBody​(TableSyntaxNode tsn)
        Gets the table body, by skipping the table header and properties sections.
        Parameters:
        tsn - inspecting table
        Returns:
        Table body without table header and properties section.
      • isHorizontalTable

        public static boolean isHorizontalTable​(ILogicalTable dataTableBody,
                                                IOpenClass tableType)
        Checks if table representation is horizontal. Horizontal is data table where parameters are listed from left to right.
        Example:
        param1 param2 param3
        param1 value param2 value param3 value
        Parameters:
        dataTableBody - the body of a table to check
        tableType - the type of data table
        Returns:
        TRUE if table is horizontal.
      • getHorizontalTable

        public static ILogicalTable getHorizontalTable​(ILogicalTable tableBody,
                                                       IOpenClass tableType)
        Gets the horizontal table representation from current table. If it was vertical it will be transposed.
        Parameters:
        tableBody - the body of a table to check
        tableType - the type of data table
        Returns:
        Horizontal representation of table.
      • getHorizontalDataWithTitle

        public static ILogicalTable getHorizontalDataWithTitle​(ILogicalTable horizDataTableBody)
        Gets the Data_With_Titles rows from the data table body. Data_With_Titles start row consider to be the next row after descriptor section of the table and till the end of the table.
        Parameters:
        horizDataTableBody - Horizontal representation of data table body.
        Returns:
        Data_With_Titles rows for current data table body.
      • getSubTableForBusinessView

        public static ILogicalTable getSubTableForBusinessView​(ILogicalTable tableBody,
                                                               IOpenClass tableType)
        Gets the sub table for displaying on business view.
        Parameters:
        tableBody - data table body.
        tableType - the type of a table
        Returns:
        Data_With_Titles section for current data table body.
      • getDescriptorRows

        public static ILogicalTable getDescriptorRows​(ILogicalTable horizDataTableBody)
        Gets the descriptor rows from the data table body. Descriptor rows are obligatory parameter row and optional foreign key row if it exists in the table.
        Parameters:
        horizDataTableBody - Horizontal representation of data table body.
        Returns:
        Descriptor rows for current data table body.
      • makeColumnTitle

        public static StringValue makeColumnTitle​(IBindingContext bindingContext,
                                                  ILogicalTable dataWithTitleRows,
                                                  int column,
                                                  boolean hasColumnTitleRow)
        Gets title for column if required or returns blank value.
        Parameters:
        dataWithTitleRows - Logical part of the data table. Consider to include all rows from base table after header section (consists from header row + property section) and descriptor section (consists from JavaBean name obligatory + optional index row, see hasForeignKeysRow(ILogicalTable)).
        This part of table may consists from optional first title row and followed data rows.
        bindingContext - is used for optimization GridCellSourceCodeModule in execution mode. Can be null.
        column - Number of column in data table.
        hasColumnTitleRow - Flag shows if data table has column tytle row.
        Returns:
        Column title (aka Display name).
      • getCollectionIndex

        public static int getCollectionIndex​(IdentifierNode fieldNameNode)