excelExporter.excelParser.dataModel

## Class ExcelWorksheet

- java.lang.Object
- - java.util.AbstractMap<java.lang.Object,java.lang.Object>
  - - excelExporter.excelParser.dataModel.ObjectMap<RowObjectContainer>
    - - excelExporter.excelParser.dataModel.RowObjectContainer
      - - excelExporter.excelParser.dataModel.ExcelWorksheet

- All Implemented Interfaces:
    java.util.Map<java.lang.Object,java.lang.Object>

      public class ExcelWorksheet
      extends RowObjectContainer

  The data structure describing a worksheet in the workbook.

  An object of this class contains the results of parsing a worksheet of an Excel input file. The object is passed as part of the data model to the template engine for rendering the information in the wanted format.

  Formally, an `ExcelWorksheet` object is a Java Map, which contains groups of Excel rows, looked up by name. Such a group of rows is represented by a `RowObjectContainer` object. The name of a group is taken from the cells in the grouping column(s) of the worksheet. If the worksheet defines two groups "myGroupA" and "myGroupB", then these groups would be accessed from a StringTemplate V4 template with an expression like `<sheet.myGroupA>` or `<sheet.myGroupB>`.

  The worksheet provides more information to the rendering process. The map of row object groups is extended by some so-called "pseudo-fields", which can be accessed from a template by means of the dot notation. As an example, the worksheet has a name and this name can be accessed by the template expression `<sheet.name_>`; where `name_` denotes a pseudo-field. (It's impossible to name a group of rows "name_", this is a reserved keyword.)

  The list of all supported pseudo-fields is documented as enumeration `ExcelWorksheet.PseudoFieldName`.

  `ExcelWorksheet` is derived from its base classes and the base classes' pseudo-fields are inherited and can be accessed in the same way. They are documented as enumerations `RowObjectContainer.PseudoFieldName` and `ObjectMap.PseudoFieldName`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ExcelWorksheet.PseudoFieldName` This is the list of pseudo-fields of class `ExcelWorksheet` that can be accessed from a StringTemplate V4 template.

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `java.util.Map.Entry<K,V>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `FileExt` | `excelFile` The file designation of the Excel source.
    `boolean` | `isRoot` This always true flag indicates that we are a Worksheet.
    `ExcelWorkbook` | `parentBook` The workbook by reference, which contains this worksheet.
    `java.lang.String` | `tabName` The title string of the tab as found in the Excel file.

    - ### Fields inherited from class excelExporter.excelParser.dataModel.RowObjectContainer

      `prop, rowAry`

    - ### Fields inherited from class excelExporter.excelParser.dataModel.ObjectMap

      `exists, i_, i0_, itemAry, itemMap, name_, objId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExcelWorksheet(excelExporter.excelParser.ErrorCounter errCnt, java.lang.String logContext, java.lang.String name)` Create a new Excel worksheet object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setParent(ExcelWorkbook parent)` Set parent of the worksheet.

    - ### Methods inherited from class excelExporter.excelParser.dataModel.RowObjectContainer

      `addRow, addRowWithPath, getNoRows, putGroup, sort`

    - ### Methods inherited from class excelExporter.excelParser.dataModel.ObjectMap

      `containsKey, createComparator, entrySet, get, getNoItems, put, putItem, setIndexInCollection, toString`

    - ### Methods inherited from class java.util.AbstractMap

      `clear, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, values`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Field Detail

    - #### excelFile

          public FileExt excelFile

      The file designation of the Excel source. File name, extension, path etc. can be accessed from a StringTemplate V4 template through the public members of class `FileExt`.

    - #### tabName

          public java.lang.String tabName

      The title string of the tab as found in the Excel file.

    - #### parentBook

          public ExcelWorkbook parentBook

      The workbook by reference, which contains this worksheet.

    - #### isRoot

          public final boolean isRoot

      This always true flag indicates that we are a Worksheet. The Java class ExcelWorksheet is a RowObjectContainer but the super class doesn't have this flag. When queried from a StringTemplate V4 template the flag will evaluate to `true` if and only if the queried container is the root container or with other words the complete Worksheet object. The disticntion between a true Worksheet and sub-groups of row objects can be useful when writing generic templates. Example:

      `<if(container.isRoot)>This is a worksheet object<else>This is a sub-group of the worksheet<endif>`

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ExcelWorksheet

          public ExcelWorksheet(excelExporter.excelParser.ErrorCounter errCnt,
                                java.lang.String logContext,
                                java.lang.String name)

      Create a new Excel worksheet object.
      Parameters:
        `errCnt` - A client supplied error counter. The use case is to permit consecutive error counting across different phases of parsing.
        `logContext` - A string used to precede all logging statements of this module. Pass null if not needed.
        `name` - The name of the object, which is the name to retrieve the object from the data model. The name should not be empty. If so a generic name is chosen instead.
      Remark:
        This method is irrelevant and meaningless to a StringTemplate V4 template.

  - ### Method Detail

    - #### setParent

          public void setParent(ExcelWorkbook parent)

      Set parent of the worksheet.
      Parameters:
        `parent` - A reference to the workbook, which contains this worksheet.
      Remark:
        This method is irrelevant and meaningless to a StringTemplate V4 template.