Class DefaultTag

  • All Implemented Interfaces:
    Tag

    public class DefaultTag
    extends Object
    implements Tag
    This class represent a Tag
    • Constructor Detail

      • DefaultTag

        public DefaultTag​(String id)
        Constructor
        Parameters:
        id - The id of the tag. The id must be unique.
      • DefaultTag

        public DefaultTag​(String id,
                          String name,
                          DefaultTag parent,
                          I18nizableText title,
                          I18nizableText description)
        Constructor
        Parameters:
        id - The id of the tag. The id must be unique.
        name - The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.
        parent - The parent tag (can be null if the tag has no parent)
        title - the tag title
        description - the tag description
    • Method Detail

      • getId

        public String getId()
        Description copied from interface: Tag
        Get the tag unique id.
        Specified by:
        getId in interface Tag
        Returns:
        The unique id
      • getName

        public String getName()
        Description copied from interface: Tag
        Get the tag name.
        Specified by:
        getName in interface Tag
        Returns:
        The tag name
      • getParent

        public DefaultTag getParent()
        Description copied from interface: Tag
        Get the parent tag
        Specified by:
        getParent in interface Tag
        Returns:
        The parent tag or null if the tag has no parent.
      • addTag

        public void addTag​(Tag tag)
        Description copied from interface: Tag
        Add a new child tag.
        Specified by:
        addTag in interface Tag
        Parameters:
        tag - The tag to add
      • getTags

        public Map<String,​DefaultTaggetTags()
        Description copied from interface: Tag
        Retrieves the Set of child tags
        Specified by:
        getTags in interface Tag
        Returns:
        The child tags in a Map
      • getTag

        public DefaultTag getTag​(String tagId)
        Description copied from interface: Tag
        Try to get a child tag by its id
        Specified by:
        getTag in interface Tag
        Parameters:
        tagId - The id of the child tag
        Returns:
        The child tag or null if not existing
      • hasTag

        public boolean hasTag​(String tagId)
        Description copied from interface: Tag
        Determines if a tag exists
        Specified by:
        hasTag in interface Tag
        Parameters:
        tagId - The tag id
        Returns:
        true if the tag exists
      • setTags

        public void setTags​(Map<String,​? extends Tag> tags)
        Description copied from interface: Tag
        Set the child tags
        Specified by:
        setTags in interface Tag
        Parameters:
        tags - The Map of Tag to set