org.ajax4jsf.model

## Class ExtendedDataModel<E>

- java.lang.Object
- - javax.faces.model.DataModel<E>
  - - org.ajax4jsf.model.ExtendedDataModel<E>

- All Implemented Interfaces:
    Iterable<E>
  Direct Known Subclasses:
    ArrangeableModel, SequenceDataModel, TreeSequenceKeyModel

      public abstract class ExtendedDataModel<E>
      extends javax.faces.model.DataModel<E>

  Extesion for `DataModel` , for support complex data structure, like tree, spreadsheet etc in iterable components.
  Author:
    shura

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtendedDataModel()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Object` | `getRowKey()`
    `abstract void` | `setRowKey(Object key)` Instead of simple `int` for current state selection, this model can use any object for select current data.
    `abstract void` | `walk(javax.faces.context.FacesContext context, DataVisitor visitor, Range range, Object argument)` Iterate over model by "visitor" pattern, for given range

    - ### Methods inherited from class javax.faces.model.DataModel

      `addDataModelListener, getDataModelListeners, getRowCount, getRowData, getRowIndex, getWrappedData, isRowAvailable, iterator, removeDataModelListener, setRowIndex, setWrappedData`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Constructor Detail

    - #### ExtendedDataModel

          public ExtendedDataModel()

  - ### Method Detail

    - #### setRowKey

          public abstract void setRowKey(Object key)

      Instead of simple `int` for current state selection, this model can use any object for select current data. Implementation depend on model, with any restrictions :

      1. key must be `Serializable`.
      2. `Object.toString()` method must return representation compatible with `UIComponent.getClientId(javax.faces.context.FacesContext)`, as far as this string will be appended to clientId of iterator component.
      Parameters:
        `key` - key for select current data, or null for clear selection.

    - #### getRowKey

          public abstract Object getRowKey()

      Returns:
        key for selected data or `null`

    - #### walk

          public abstract void walk(javax.faces.context.FacesContext context,
                                    DataVisitor visitor,
                                    Range range,
                                    Object argument)

      Iterate over model by "visitor" pattern, for given range
      Parameters:
        `context` - current JSF context.
        `visitor` - instance of `DataVisitor`, for process each row.
        `range` - Implementation-specific range of data keys.
        `argument` - Implementation-specific argument
      Throws:
        `IOException`

Copyright © 2016 JBoss by Red Hat. All Rights Reserved.