Package org.openhab.core.config.core.xml
Class AbstractXmlConfigDescriptionProvider
java.lang.Object
org.openhab.core.config.core.xml.AbstractXmlBasedProvider<URI,ConfigDescription>
org.openhab.core.config.core.xml.AbstractXmlConfigDescriptionProvider
- All Implemented Interfaces:
ConfigDescriptionProvider
- Direct Known Subclasses:
ConfigXmlConfigDescriptionProvider
@NonNullByDefault
public abstract class AbstractXmlConfigDescriptionProvider
extends AbstractXmlBasedProvider<URI,ConfigDescription>
implements ConfigDescriptionProvider
The
AbstractXmlConfigDescriptionProvider
is a concrete implementation of the
ConfigDescriptionProvider
service interface.
This implementation manages any ConfigDescription
objects associated to specific modules. If a specific
module disappears, any registered ConfigDescription
objects associated with that module are released.
- Author:
- Michael Grammling - Initial contribution, Dennis Nobel - Added locale support, Alex Tugarev - Extended for pattern and options, Chris Jackson - Modify to use config parameter builder, Thomas Höfer - Extended for unit, Markus Rathgeb - Use ConfigI18nLocalizerService, Simon Kaufmann - factored out common aspects into
AbstractXmlBasedProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable ConfigDescription
getConfigDescription
(URI uri, @Nullable Locale locale) Provides aConfigDescription
for the given URI.getConfigDescriptions
(@Nullable Locale locale) Provides a collection ofConfigDescription
s.protected abstract ConfigI18nLocalizationService
protected @Nullable ConfigDescription
localize
(org.osgi.framework.Bundle bundle, ConfigDescription configDescription, @Nullable Locale locale) Create a translated/localized copy of the given object.
-
Constructor Details
-
AbstractXmlConfigDescriptionProvider
public AbstractXmlConfigDescriptionProvider()
-
-
Method Details
-
getConfigDescriptions
Description copied from interface:ConfigDescriptionProvider
Provides a collection ofConfigDescription
s.- Specified by:
getConfigDescriptions
in interfaceConfigDescriptionProvider
- Parameters:
locale
- locale- Returns:
- the configuration descriptions provided by this provider (not null, could be empty)
-
getConfigDescription
Description copied from interface:ConfigDescriptionProvider
Provides aConfigDescription
for the given URI.- Specified by:
getConfigDescription
in interfaceConfigDescriptionProvider
- Parameters:
uri
- uri of the config descriptionlocale
- locale- Returns:
- config description or null if no config description could be found
-
localize
protected @Nullable ConfigDescription localize(org.osgi.framework.Bundle bundle, ConfigDescription configDescription, @Nullable Locale locale) Description copied from class:AbstractXmlBasedProvider
Create a translated/localized copy of the given object.- Specified by:
localize
in classAbstractXmlBasedProvider<URI,
ConfigDescription> - Parameters:
bundle
- the module to be used for the look-up of the translationsconfigDescription
- the object to translatelocale
- the target locale- Returns:
- a translated copy of the given object or
null
if translation was not possible.
-
getConfigI18nLocalizerService
-