Class AbstractDynamicDescriptionProvider

java.lang.Object
org.openhab.core.thing.binding.AbstractDynamicDescriptionProvider
Direct Known Subclasses:
BaseDynamicCommandDescriptionProvider, BaseDynamicStateDescriptionProvider

@NonNullByDefault public abstract class AbstractDynamicDescriptionProvider extends Object
The AbstractDynamicDescriptionProvider provides a base implementation for dynamic description providers.

It holds a reference to the ChannelTypeI18nLocalizationService to provide localized descriptions. Therefore the inheriting class has to request a reference for the ChannelTypeI18nLocalizationService on its own.

It posts ChannelDescriptionChangedEvents through the openHAB events bus about a changed dynamic description. Therefore the subclass has to request references for the EventPublisher and ItemChannelLinkRegistry.

Author:
Christoph Weitkamp - Initial contribution
  • Field Details

    • bundleContext

      @NonNullByDefault({}) protected org.osgi.framework.BundleContext bundleContext
    • eventPublisher

      protected @Nullable EventPublisher eventPublisher
    • channelTypeI18nLocalizationService

      protected @Nullable ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService
    • itemChannelLinkRegistry

      protected @Nullable ItemChannelLinkRegistry itemChannelLinkRegistry
  • Constructor Details

    • AbstractDynamicDescriptionProvider

      public AbstractDynamicDescriptionProvider()
  • Method Details

    • postEvent

      protected void postEvent(Event event)
      This method can be used in a subclass in order to post events through the openHAB events bus. A common use case is to notify event subscribers about a changed dynamic description.
      Parameters:
      event - the Event
    • activate

      protected void activate(org.osgi.service.component.ComponentContext componentContext)
    • deactivate

      public void deactivate()