Package org.openhab.core.model.item
Interface BindingConfigReader
@NonNullByDefault
public interface BindingConfigReader
This interface must be implemented by services, which can parse the generic
binding configuration string used in the
GenericItemProvider
.- Author:
- Kai Kreuzer - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionThis defines the type of binding this reader will process, e.g.void
processBindingConfiguration
(String context, String itemType, String itemName, String bindingConfig, Configuration configuration) This method is called by theGenericItemProvider
whenever it comes across a binding configuration string for an item.void
startConfigurationUpdate
(String context) Informs the reader that configurations will be processed for a given context.void
stopConfigurationUpdate
(String context) Informs the reader that configuration update is completed for a given context.void
validateItemType
(String itemType, String bindingConfig) Validates if the type ofitem
is valid for this binding.
-
Method Details
-
getBindingType
String getBindingType()This defines the type of binding this reader will process, e.g. "knx".- Returns:
- the type of the binding
-
validateItemType
Validates if the type ofitem
is valid for this binding.- Parameters:
itemType
- the type of the item to validatebindingConfig
- the config string which could be used to refine the validation- Throws:
BindingConfigParseException
- if the item type is invalid for this binding
-
processBindingConfiguration
void processBindingConfiguration(String context, String itemType, String itemName, String bindingConfig, Configuration configuration) throws BindingConfigParseException This method is called by theGenericItemProvider
whenever it comes across a binding configuration string for an item.- Parameters:
context
- a string of the context from where this item comes from. Usually the file name of the config fileitemType
- the item type for which the binding config is defineditemName
- the item name for which the binding config is definedbindingConfig
- the configuration string that must be processed- Throws:
BindingConfigParseException
- if the configuration string is not valid
-
startConfigurationUpdate
Informs the reader that configurations will be processed for a given context. This is usually called if a config file is reloaded, so that the old values are removed, before the new ones are processed.- Parameters:
context
- the context of the configurations that will be processed
-
stopConfigurationUpdate
Informs the reader that configuration update is completed for a given context. This is usually called after a config file is reloaded, so that the reader can clean up afterwards.- Parameters:
context
- the context of the configurations that were processed
-