Class AbstractItemFileGenerator

java.lang.Object
org.openhab.core.items.fileconverter.AbstractItemFileGenerator
All Implemented Interfaces:
ItemFileGenerator

@NonNullByDefault public abstract class AbstractItemFileGenerator extends Object implements ItemFileGenerator
AbstractItemFileGenerator is the base class for any Item file generator.
Author:
Laurent Garnier - Initial contribution
  • Constructor Details

    • AbstractItemFileGenerator

      public AbstractItemFileGenerator()
  • Method Details

    • getChannelLinks

      protected List<Metadata> getChannelLinks(Collection<Metadata> metadata, String itemName)
      Get the list of available channel links for an item, sorted by natural order of their channel UID.
      Parameters:
      metadata - a collection of metadata
      itemName - the item name
      Returns:
      the sorted list of metadata representing the channel links for this item
    • getMetadata

      protected List<Metadata> getMetadata(Collection<Metadata> metadata, String itemName)
      Get the list of available metadata for an item, sorted by natural order of their namespaces. The "semantics" and "channel" namespaces are ignored.
      Parameters:
      metadata - a collection of metadata
      itemName - the item name
      Returns:
      the sorted list of metadata for this item
    • getConfigurationParameters

      protected List<AbstractItemFileGenerator.ConfigParameter> getConfigurationParameters(Metadata metadata)
      Get the list of configuration parameters for a metadata, sorted by natural order of their names with the exception of the "stateDescription" namespace where "min", "max" and "step" parameters are provided at first in this order.
      Parameters:
      metadata - the metadata
      Returns:
      a sorted list of configuration parameters for the metadata
    • getDefaultStatePattern

      protected @Nullable String getDefaultStatePattern(Item item)
      Get the default state pattern for an item.
      Parameters:
      item - the item
      Returns:
      the default state pattern of null if no default