excelExporter.excelParser.dataModel

## Class RowObject

- java.lang.Object
- - java.util.AbstractMap<java.lang.Object,java.lang.Object>
  - - excelExporter.excelParser.dataModel.ObjectMap<CellObject>
    - - excelExporter.excelParser.dataModel.RowObject

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

      public class RowObject
      extends ObjectMap<CellObject>

  The row of an Excel worksheet as map of properties. Each cell of the row is such a property and the key to access it is the name of the column it is found in.

  The row obect has additional fields, which represent predefined properties (e.g. the coordinates of the cell in the worksheet) or support the iteration along all cell based properties.

  An object of this class contains the results of parsing one row of a worksheet in 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 `RowObject` object is a Java Map, which contains Excel cells, looked up by (property) name. The name of a property is subject to the application configuration. It might be the contents of the top most cell of the column in the Excel worksheet but this is not a must and not even common practice. If the application has parsed an Excel worksheet with two columns "A" and "B", then the related properties of the row object would be accessed from a StringTemplate V4 template with an expression like `<row.A>` or `<row.B>`.

  Note, empty cells in the Excel worksheet are not added to the `RowObject` object. They are not represented by `CellObject` objects. If a template expression like `<row.A>` hits an empty cell then the expression evaluates to null. Consequently, commonly available cell information like row and column index is not available for empty cells. Refer to `CellObject.isNotBlank` for a detailed consideration how to handle the distinction between empty and non empty cells from a template.

  The row object provides more information to the rendering process. The map of cells or properties is extended by some so-called "pseudo-fields", which can be accessed from a template by means of the same dot notation. As an example, the row object has a row number and this number can be accessed by the template expression `<row.iRow>`; where `iRow` denotes a pseudo-field. (It's impossible to name a property (i.e. to title a column) "iRow", this is a reserved keyword.)

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

  `RowObject` is derived from its base class and the base class' pseudo-fields are inherited and can be accessed in the same way. They are documented as enumeration `ObjectMap.PseudoFieldName`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RowObject.PseudoFieldName` This is the list of pseudo-fields of class `RowObject` 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
    --- | ---
    `int` | `i0Row` The null based index of the row in the worksheet.
    `int` | `iRow` The one based index of the row in the worksheet.

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RowObject(excelExporter.excelParser.ErrorCounter errCnt, java.lang.String logContext, int idxRow)` Create a new row object.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SortOrder.Comparator<RowObject>` | `createComparator(SortOrder.Order sortOrder, java.lang.String propName)` A comparator for sorting row objects in a collection is created and returned.
    `boolean` | `putCell(java.lang.String propName, CellObject cellObj)` Add a cell object to the map.

    - ### 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

    - #### i0Row

          public final int i0Row

      The null based index of the row in the worksheet.

    - #### iRow

          public final int iRow

      The one based index of the row in the worksheet.

  - ### Constructor Detail

    - #### RowObject

          public RowObject(excelExporter.excelParser.ErrorCounter errCnt,
                           java.lang.String logContext,
                           int idxRow)

      Create a new row 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.
        `idxRow` - The null based index of the row in the worksheet.

  - ### Method Detail

    - #### putCell

          public boolean putCell(java.lang.String propName,
                                 CellObject cellObj)

      Add a cell object to the map.
      Parameters:
        `propName` - A cell represents a property of the row object. This is the name of the property; the name is the key into the map to later access it.
        `cellObj` - The object to add.
      Returns:
        Get the Boolean information whether the cell object could be added to the map. Adding can fail if the property name clashes with a reserved keyword or an already existing property.

    - #### createComparator

          public static SortOrder.Comparator<RowObject> createComparator(SortOrder.Order sortOrder,
                                                                         java.lang.String propName)

      A comparator for sorting row objects in a collection is created and returned.
      Parameters:
        `sortOrder` - The desired sort order.
        `propName` - The row objects can be sorted according to the values of a single property. The name of the property is passed in. Objects, which don't have the property at all will come behind those having the property.
      Returns:
        Get the temporary comparator object as usable with the Java Collections class.