com.holonplatform.vaadin.data

## Interface ItemDataSource.Configuration<ITEM,PROPERTY>

- Type Parameters:
    `ITEM` - Item type
    `PROPERTY` - Item property type
  All Superinterfaces:
    Serializable
  Enclosing interface:
    ItemDataSource<ITEM,PROPERTY>

      public static interface ItemDataSource.Configuration<ITEM,PROPERTY>
      extends Serializable

  Item data source configuration.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<ItemDataSource.CommitHandler<ITEM>>` | `getCommitHandler()` Get the commit handler
    `Optional<ItemDataProvider<ITEM>>` | `getDataProvider()` Get the item data provider.
    `Optional<ItemIdentifierProvider<ITEM,?>>` | `getItemIdentifierProvider()` Get the `ItemIdentifierProvider`.
    `List<ItemDataSource.ItemSort<PROPERTY>>` | `getItemSorts()` Get current data source items sorting directives properties, providing item property to sort and direction.
    `Iterable<PROPERTY>` | `getProperties()` Get available item properties.
    `Optional<PROPERTY>` | `getPropertyById(String propertyId)` Get the property which corresponds to given id, if available.
    `Object` | `getPropertyDefaultValue(PROPERTY property)` Get the default value for the given property.
    `Optional<String>` | `getPropertyId(PROPERTY property)` Get the String id associated to given property, if available.
    `Optional<ItemDataSource.PropertySortGenerator<PROPERTY>>` | `getPropertySortGenerator(PROPERTY property)` Get the `ItemDataSource.PropertySortGenerator` bound to given property, if any.
    `Class<?>` | `getPropertyType()` Get the property representation type.
    `Class<?>` | `getPropertyType(PROPERTY property)` Gets the data type of the given data source property.
    `Optional<com.holonplatform.core.query.QueryFilter>` | `getQueryFilter()` Get the `QueryFilter` according to this configuration, taking into account the fixed filters and the query filters from any registered `QueryConfigurationProvider`.
    `com.holonplatform.core.ParameterSet` | `getQueryParameters()` Get the query parameters according to this configuration, taking into account the query parameters from any registered `QueryConfigurationProvider`.
    `Optional<com.holonplatform.core.query.QuerySort>` | `getQuerySort(Collection<com.holonplatform.core.query.QuerySort> currentSorts)` Get the `QuerySort` according to this configuration, taking into account the item sorts, default and fixed sorts and the query sorts from any registered `QueryConfigurationProvider`.
    `boolean` | `isAutoRefresh()` Returns whether auto-refresh is enabled for this data source, i.e. items are loaded when one of the data source methods which involve operations on item set is called.
    `boolean` | `isPropertyReadOnly(PROPERTY property)` Get whether the given property is read only.
    `boolean` | `isPropertySortable(PROPERTY property)` Get whether the given property is sortable.

- - ### Method Detail

    - #### getPropertyType

          Class<?> getPropertyType()

      Get the property representation type.
      Returns:
        Property type

    - #### getItemIdentifierProvider

          Optional<ItemIdentifierProvider<ITEM,?>> getItemIdentifierProvider()

      Get the `ItemIdentifierProvider`.
      Returns:
        the item identifier provider

    - #### getDataProvider

          Optional<ItemDataProvider<ITEM>> getDataProvider()

      Get the item data provider.
      Returns:
        the item data provider

    - #### getCommitHandler

          Optional<ItemDataSource.CommitHandler<ITEM>> getCommitHandler()

      Get the commit handler
      Returns:
        the commit handler

    - #### getProperties

          Iterable<PROPERTY> getProperties()

      Get available item properties.
      Returns:
        Available item properties iterable

    - #### getPropertyType

          Class<?> getPropertyType(PROPERTY property)

      Gets the data type of the given data source property.
      Parameters:
        `property` - Property (not null)
      Returns:
        Property data type

    - #### getPropertyId

          Optional<String> getPropertyId(PROPERTY property)

      Get the String id associated to given property, if available.
      Parameters:
        `property` - Property (not null)
      Returns:
        Optional property id

    - #### getPropertyById

          Optional<PROPERTY> getPropertyById(String propertyId)

      Get the property which corresponds to given id, if available.
      Parameters:
        `propertyId` - Property id
      Returns:
        Optional property which corresponds to given id

    - #### isPropertyReadOnly

          boolean isPropertyReadOnly(PROPERTY property)

      Get whether the given property is read only.
      Parameters:
        `property` - Property (not null)
      Returns:
        `true` if property is read only, `false` otherwise

    - #### isPropertySortable

          boolean isPropertySortable(PROPERTY property)

      Get whether the given property is sortable.
      Parameters:
        `property` - Property (not null)
      Returns:
        `true` if property is sortable, `false` otherwise

    - #### getPropertySortGenerator

          Optional<ItemDataSource.PropertySortGenerator<PROPERTY>> getPropertySortGenerator(PROPERTY property)

      Get the `ItemDataSource.PropertySortGenerator` bound to given property, if any.
      Parameters:
        `property` - Property (not null)
      Returns:
        Optional property sort generator

    - #### getPropertyDefaultValue

          Object getPropertyDefaultValue(PROPERTY property)

      Get the default value for the given property.
      Parameters:
        `property` - Property (not null)
      Returns:
        Property default value, or `null` if not available

    - #### isAutoRefresh

          boolean isAutoRefresh()

      Returns whether auto-refresh is enabled for this data source, i.e. items are loaded when one of the data source methods which involve operations on item set is called.

      If auto-refresh is not enabled, `ItemDataSource.refresh()` method must be called to load items.

      Default is `true`.

      Returns:
        Whether auto-refresh is enabled for this data source

    - #### getItemSorts

          List<ItemDataSource.ItemSort<PROPERTY>> getItemSorts()

      Get current data source items sorting directives properties, providing item property to sort and direction.
      Returns:
        Data source items sorting directives, or an empty list if none

    - #### getQuerySort

          Optional<com.holonplatform.core.query.QuerySort> getQuerySort(Collection<com.holonplatform.core.query.QuerySort> currentSorts)

      Get the `QuerySort` according to this configuration, taking into account the item sorts, default and fixed sorts and the query sorts from any registered `QueryConfigurationProvider`.
      Parameters:
        `currentSorts` - Optional corrent query sorts
      Returns:
        The `QuerySort`, if available

    - #### getQueryFilter

          Optional<com.holonplatform.core.query.QueryFilter> getQueryFilter()

      Get the `QueryFilter` according to this configuration, taking into account the fixed filters and the query filters from any registered `QueryConfigurationProvider`.
      Returns:
        The `QueryFilter`, if available

    - #### getQueryParameters

          com.holonplatform.core.ParameterSet getQueryParameters()

      Get the query parameters according to this configuration, taking into account the query parameters from any registered `QueryConfigurationProvider`.
      Returns:
        The query parameters set, empty if no parameters available

Copyright © 2019 The Holon Platform. All rights reserved.