A builder class for constructing and modifying a DataContainer instance.

This class provides methods to retrieve, and append tables within a DataContainer.

Example

const dataContainerBuilder = Parser.createContainerBuilder(initialDataContainer)

// Create or get a table and add columns or rows
const { tableBuilder, isNew } = dataContainerBuilder.getTable('myTable')
tableBuilder.addColumnHeader({ name: 'column1', dataType: 'string' });
tableBuilder.addColumnHeader({ name: 'column2', dataType: 'string' });
tableBuilder.addRow({ column1: 'value1', column2: 'value2' });

// Get the final DataContainer
const finalDataContainer = dataContainerBuilder.getDataContainer()

Hierarchy

  • DataContainerBuilder

Methods

  • Gets the final DataContainer instance after building and modifying it.

    Returns DataContainer

    The constructed DataContainer instance.

  • Retrieves a table builder for the specified table name. If the table does not exist, a new table is created within the DataContainer.

    Parameters

    • name: string

      The name of the table.

    Returns {
        isNew: boolean;
        tableBuilder: DataTableBuilder;
    }

    An object containing the table builder and a boolean indicating whether the table is newly created.

Generated using TypeDoc