Package org.jboss.windup.config.tags
Class Tag
- java.lang.Object
-
- org.jboss.windup.config.tags.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContainedTag(Tag tag)Loops are not checked here.voidaddContainingTag(Tag tag)Loops are not checked here.booleanequals(Object obj)StringgetColor()A color by which this tag should typically be represented in the UI elements like tags, boxes, chart lines, graph nodes, etc.Set<Tag>getContainedTags()Which tags are designated by this tag; for instance, "java-ee" designates "ejb" and "jms".StringgetName()Tag name (ID), preferably kebab-style, e.g "java-ee-6".Map<String,String>getOrCreateTraits()Set<Tag>getParentTags()Which tags are designated by this tag; for instance, "seam" is designated by "web" and "framework:".StringgetTitle()Human readable title of technology this tag represents, e.g "Java EE 6".StringgetTitleOrName()Map<String,String>getTraits()Returns the traits map, or null if it was not yet initialized.inthashCode()booleanisPrime()A "prime" tag is one which is an important group of subtags, suitable for showing in aggregated reports.booleanisPseudo()Pseudo tags serve as grouping for contained tags, but are not suitable to be a root tag.booleanisRoot()A root tag is that which was a root in the XML definition files.static StringnormalizeName(String name)voidsetColor(String color)voidsetIsPrime(boolean isPrime)voidsetIsRoot(boolean isRoot)voidsetPseudo(boolean isPseudo)voidsetTitle(String title)StringtoString()
-
-
-
Method Detail
-
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.
-
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.
-
-