-
-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move generic repository stuff to bundle org.openhab.core.model.core
Signed-off-by: Laurent Garnier <[email protected]>
- Loading branch information
Showing
10 changed files
with
137 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...hab.core.model.core/src/main/java/org/openhab/core/model/core/yaml/YamlModelListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* Copyright (c) 2010-2023 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.core.model.core.yaml; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link YamlModelListener} interface is responsible for managing a particular model type | ||
* with data processed from YAML configuration files. | ||
* | ||
* @author Laurent Garnier - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public interface YamlModelListener<T extends YamlElement> { | ||
|
||
/** | ||
* Method called by the model repository when elements from a model are added. | ||
* | ||
* @param modelName the name of the model | ||
* @param elements the list of added elements | ||
*/ | ||
void addedModel(String modelName, List<? extends YamlElement> elements); | ||
|
||
/** | ||
* Method called by the model repository when elements from a model are updated. | ||
* | ||
* @param modelName the name of the model | ||
* @param elements the list of updated elements | ||
*/ | ||
void updatedModel(String modelName, List<? extends YamlElement> elements); | ||
|
||
/** | ||
* Method called by the model repository when elements from a model are removed. | ||
* | ||
* @param modelName the name of the model | ||
* @param elements the list of removed elements | ||
*/ | ||
void removedModel(String modelName, List<? extends YamlElement> elements); | ||
|
||
/** | ||
* Get the root name of this model type which is also the name of the root folder | ||
* containing the user files for this model type. | ||
* | ||
* A path is unexpected. What is expected is for example "items" or "things". | ||
* | ||
* @return the model root name | ||
*/ | ||
String getRootName(); | ||
|
||
/** | ||
* Get the DTO class to be used for a file providing objects for this model type. | ||
* | ||
* @return the DTO file class | ||
*/ | ||
Class<? extends YamlFile> getFileClass(); | ||
|
||
/** | ||
* Get the DTO class to be used for each object of this model type. | ||
* | ||
* @return the DTO element class | ||
*/ | ||
Class<T> getElementClass(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
...core.semantics/src/main/java/org/openhab/core/semantics/model/yaml/YamlModelListener.java
This file was deleted.
Oops, something went wrong.