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 TypeMethodDescriptionvoidaddElementsToBeGenerated(String id, List<YamlElement> elements) Associate a list of elements to be generated to an identifier.voidaddElementToModel(String modelName, YamlElement element) @Nullable StringcreateIsolatedModel(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.voidgenerateFileFormat(String id, OutputStream out) Generate the YAML file format for all elements that were associated to the provided identifier.voidremoveElementFromModel(String modelName, YamlElement element) voidremoveIsolatedModel(String modelName) Removes an isolated model from the repositoryvoidupdateElementInModel(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
-