Class Tag


  • public final class Tag
    extends Object
    Represents a tag. Determined by it's lowercased name. The structure is not a tree - a tag may have multiple "parents". Note that the "parent" and "contained tags" is misleading. The tags structure is in fact an oriented acyclic graph. (It could even be cyclic if we allowed for synonyms.) Better names would be "designated tags" and "designated by tags" or such.
    Author:
    Ondrej Zizka
    • Method Detail

      • normalizeName

        public static String normalizeName​(String name)
      • getName

        public String getName()
        Tag name (ID), preferably kebab-style, e.g "java-ee-6".
      • getContainedTags

        public Set<Tag> getContainedTags()
        Which tags are designated by this tag; for instance, "java-ee" designates "ejb" and "jms".
      • getParentTags

        public Set<Tag> getParentTags()
        Which tags are designated by this tag; for instance, "seam" is designated by "web" and "framework:".
      • addContainedTag

        public void addContainedTag​(Tag tag)
        Loops are not checked here.
      • addContainingTag

        public void addContainingTag​(Tag tag)
        Loops are not checked here.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isRoot

        public boolean isRoot()
        A root tag is that which was a root in the XML definition files. These serve as entry point shortcuts when browsing the graph.
      • setIsRoot

        public void setIsRoot​(boolean isRoot)
      • isPrime

        public boolean isPrime()
        A "prime" tag is one which is an important group of subtags, suitable for showing in aggregated reports. For instance, "Java EE" is a good prime tag, as it may contain other technologies. Whereas "frameworks" is probably not a good prime tag as it's too general.
      • setIsPrime

        public void setIsPrime​(boolean isPrime)
      • isPseudo

        public boolean isPseudo()
        Pseudo tags serve as grouping for contained tags, but are not suitable to be a root tag. They are also suitable for tagging related tags. In the XML files definition, such pseudo tags are often referred to by the parents="..." attribute. For instance, "framework:" or "application-server:" is a suitable pseudo tag, which can demarcate tags like "wicket" or "jboss-eap". By convention, the names are lower case, singular, and end with a colon.
      • setPseudo

        public void setPseudo​(boolean isPseudo)
      • getColor

        public String getColor()
        A color by which this tag should typically be represented in the UI elements like tags, boxes, chart lines, graph nodes, etc.
      • setColor

        public void setColor​(String color)
      • getTitle

        public String getTitle()
        Human readable title of technology this tag represents, e.g "Java EE 6".
      • setTitle

        public void setTitle​(String title)
      • getTitleOrName

        public String getTitleOrName()
      • getTraits

        public Map<String,​String> getTraits()
        Returns the traits map, or null if it was not yet initialized.