Package org.openhab.core.model.yaml
Interface YamlModelRepository
@NonNullByDefault
public interface YamlModelRepository
The
YamlModelRepository
defines methods to update elements in a YAML model.- Author:
- Jan N. Klug - Initial contribution, Laurent Garnier - Added methods addElementsToBeGenerated, generateFileFormat, createIsolatedModel and removeIsolatedModel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElementsToBeGenerated
(String id, List<YamlElement> elements) Associate a list of elements to be generated to an identifier.void
addElementToModel
(String modelName, YamlElement element) @Nullable String
createIsolatedModel
(InputStream inputStream, List<String> errors, List<String> warnings) Creates an isolated model in the repository An isolated model is a temporary model loaded without impacting any object registry.void
generateFileFormat
(String id, OutputStream out) Generate the YAML file format for all elements that were associated to the provided identifier.void
removeElementFromModel
(String modelName, YamlElement element) void
removeIsolatedModel
(String modelName) Removes an isolated model from the repositoryvoid
updateElementInModel
(String modelName, YamlElement element)
-
Method Details
-
addElementToModel
-
removeElementFromModel
-
updateElementInModel
-
addElementsToBeGenerated
Associate a list of elements to be generated to an identifier.- Parameters:
id
- the identifier of the file format generationelements
- the elements to be added
-
generateFileFormat
Generate the YAML file format for all elements that were associated to the provided identifier.- Parameters:
id
- the identifier of the file format generationout
- the output stream to write to
-
createIsolatedModel
@Nullable String createIsolatedModel(InputStream inputStream, List<String> errors, List<String> warnings) Creates an isolated model in the repository An isolated model is a temporary model loaded without impacting any object registry.- Parameters:
inputStream
- an input stream with the model's contenterrors
- the list to be used to fill the errorswarnings
- the list to be used to fill the warnings- Returns:
- the created model name if it was successfully processed, null otherwise
-
removeIsolatedModel
Removes an isolated model from the repository- Parameters:
modelName
- the name of the model to be removed
-