Package org.openhab.core.model.yaml
Interface YamlModelListener<T extends YamlElement>
The
YamlModelListener
interface is responsible for managing a particular model type
with data processed from YAML configuration files.
Implementors are notified whenever a YAML model changed that contains elements of the given type. They MUST declare
at least YamlModelListener
as service to automatically register them with the repository.- Author:
- Laurent Garnier - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addedModel
(String modelName, Collection<T> elements) Method called by the model repository when elements from a model are added.Get the DTO class to be used for each object of this model type.void
removedModel
(String modelName, Collection<T> elements) Method called by the model repository when elements from a model are removed.void
updatedModel
(String modelName, Collection<T> elements) Method called by the model repository when elements from a model are updated.
-
Method Details
-
addedModel
Method called by the model repository when elements from a model are added. Only added elements are contained in the collection. In case the listener is added after a model was read, this method is also called with all elements from that model.- Parameters:
modelName
- the name of the modelelements
- the collection of added elements
-
updatedModel
Method called by the model repository when elements from a model are updated. Only changed elements are contained in the collection.- Parameters:
modelName
- the name of the modelelements
- the collection of updated elements
-
removedModel
Method called by the model repository when elements from a model are removed.- Parameters:
modelName
- the name of the modelelements
- the collection of removed elements
-
getElementClass
Get the DTO class to be used for each object of this model type. The DTO class MUST implementYamlElement
and fulfill all requirements defined for the interface.- Returns:
- the DTO element class
-