Package org.openhab.core.semantics
Interface SemanticTagRegistry
- All Superinterfaces:
Registry<SemanticTag,
String>
SemanticTagRegistry
tracks all SemanticTag
s from different SemanticTagProvider
s
and provides access to them.- Author:
- Laurent Garnier - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canBeAdded
(SemanticTag tag) Checks if a tag with a given id can be added to the registry.getSubTree
(SemanticTag tag) Returns the provided tag + all tags having the provided tag as ancestor.getTagClassById
(String tagId) Retrieves the class for a given id.boolean
isEditable
(SemanticTag tag) Indicates if a tag is editable.void
removeSubTree
(SemanticTag tag) Removes the provided tag and all tags having the provided tag as ancestor.Methods inherited from interface org.openhab.core.common.registry.Registry
add, addRegistryChangeListener, get, getAll, remove, removeRegistryChangeListener, stream, update
-
Method Details
-
getTagClassById
Retrieves the class for a given id.- Parameters:
tagId
- the id of the tag. The id can be fully qualified (e.g. "Location_Room_Bedroom") or a segment, if this uniquely identifies the tag (e.g. "Bedroom").- Returns:
- the class for the id or null, if non exists.
-
canBeAdded
Checks if a tag with a given id can be added to the registry. To be added, no tag with this id must already exist in the registry, the tag name extracted from this id must have a valid syntax, the parent tag extracted from this id must already exist in the registry and should be either a default semantic tag or a managed semantic tag, and no tag with a same name must already exist in the registry.- Parameters:
tag
- a tag to be added to the registry- Returns:
- true if the tag can be added, false if not
-
getSubTree
Returns the provided tag + all tags having the provided tag as ancestor.- Parameters:
tag
- a tag in the registry- Returns:
- a list of all tags having the provided tag as ancestor, including the provided tag itself
-
isEditable
Indicates if a tag is editable. To be editable, a tag must be managed.- Parameters:
tag
- a tag in the registry- Returns:
- true if the provided tag is editable, false if not
-
removeSubTree
Removes the provided tag and all tags having the provided tag as ancestor. Only removable (managed) tags are removed.- Parameters:
tag
- a tag in the registry
-