Interface SemanticTagRegistry

All Superinterfaces:
Registry<SemanticTag,String>

@NonNullByDefault public interface SemanticTagRegistry extends Registry<SemanticTag,String>
SemanticTagRegistry tracks all SemanticTags from different SemanticTagProviders and provides access to them.
Author:
Laurent Garnier - Initial contribution
  • Method Details

    • getTagClassById

      @Nullable Class<? extends Tag> getTagClassById(String tagId)
      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

      boolean canBeAdded(SemanticTag tag)
      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

      List<SemanticTag> getSubTree(SemanticTag tag)
      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

      boolean isEditable(SemanticTag tag)
      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

      void removeSubTree(SemanticTag tag)
      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