Class ConfigDescriptionRegistry

java.lang.Object
org.openhab.core.config.core.ConfigDescriptionRegistry

@NonNullByDefault public class ConfigDescriptionRegistry extends Object
ConfigDescriptionRegistry provides access to ConfigDescriptions. It tracks ConfigDescriptionProvider OSGi services to collect all ConfigDescriptions.
Author:
Dennis Nobel - Initial contribution, Michael Grammling - Initial contribution, Chris Jackson - Added compatibility with multiple ConfigDescriptionProviders. Added Config OptionProvider., Thomas Höfer - Added unit
See Also:
  • Constructor Details

    • ConfigDescriptionRegistry

      public ConfigDescriptionRegistry()
  • Method Details

    • addConfigOptionProvider

      protected void addConfigOptionProvider(ConfigOptionProvider configOptionProvider)
    • removeConfigOptionProvider

      protected void removeConfigOptionProvider(ConfigOptionProvider configOptionProvider)
    • addConfigDescriptionProvider

      protected void addConfigDescriptionProvider(ConfigDescriptionProvider configDescriptionProvider)
    • removeConfigDescriptionProvider

      protected void removeConfigDescriptionProvider(ConfigDescriptionProvider configDescriptionProvider)
    • addConfigDescriptionAliasProvider

      protected void addConfigDescriptionAliasProvider(ConfigDescriptionAliasProvider configDescriptionAliasProvider)
    • removeConfigDescriptionAliasProvider

      protected void removeConfigDescriptionAliasProvider(ConfigDescriptionAliasProvider configDescriptionAliasProvider)
    • getConfigDescriptions

      public Collection<ConfigDescription> getConfigDescriptions(@Nullable Locale locale)
      Returns all config descriptions.

      If more than one ConfigDescriptionProvider is registered for a specific URI, then the returned ConfigDescription collection will contain the data from all providers.

      No checking is performed to ensure that multiple providers don't provide the same configuration data. It is up to the binding to ensure that multiple sources (eg static XML and dynamic binding data) do not contain overlapping information.

      Parameters:
      locale - locale
      Returns:
      all config descriptions or an empty collection if no config description exists
    • getConfigDescriptions

      public Collection<ConfigDescription> getConfigDescriptions()
      Returns all config descriptions.
      Returns:
      all config descriptions or an empty collection if no config description exists
    • getConfigDescription

      public @Nullable ConfigDescription getConfigDescription(URI uri, @Nullable Locale locale)
      Returns a config description for a given URI.

      If more than one ConfigDescriptionProvider is registered for the requested URI, then the returned ConfigDescription will contain the data from all providers.

      No checking is performed to ensure that multiple providers don't provide the same configuration data. It is up to the binding to ensure that multiple sources (eg static XML and dynamic binding data) do not contain overlapping information.

      Parameters:
      uri - the URI to which the config description to be returned (must not be null)
      locale - locale
      Returns:
      config description or null if no config description exists for the given name
    • getConfigDescription

      public @Nullable ConfigDescription getConfigDescription(URI uri)
      Returns a config description for a given URI.
      Parameters:
      uri - the URI to which the config description to be returned (must not be null)
      Returns:
      config description or null if no config description exists for the given name