Tabnine Logo
TagModel
Code IndexAdd Tabnine to your IDE (free)

How to use
TagModel
in
org.jboss.windup.reporting.model

Best Java code snippets using org.jboss.windup.reporting.model.TagModel (Showing top 18 results out of 315)

origin: org.jboss.windup.reporting/windup-reporting-api

  throw new IllegalArgumentException("Sub tag param was null. Super tag: " + superTag);
if (superTag.getName().equals(subTag.getName()))
  return true;
  for (TagModel currentTag : currentSet)
    for (TagModel parent : currentTag.getDesignatedByTags()) {
      if (superTag.equals(parent))
        return true;
origin: org.jboss.windup.reporting/windup-reporting-api

private void getDescendantTags(TagModel tag, Set<TagModel> putResultsHere)
{
  for (TagModel childTag : tag.getDesignatedTags())
  {
    if (!putResultsHere.add(childTag))
      continue; // Already visited.
    getDescendantTags(childTag, putResultsHere);
  }
}
origin: org.jboss.windup.reporting/windup-reporting-api

default String getTitleOrName()
{
  return StringUtils.defaultString(this.getTitle(), this.getName());
}
origin: org.jboss.windup.reporting/windup-reporting-api

/**
 * Creates and returns the TagModel in a graph as per given Tag;
 * recursively creates the designated ("contained") tags.
 * <p>
 * If the Tag was already processed exists, returns the corresponding TagModel.
 * Doesn't check if the TagModel for given tag name already exists, assuming this method is only called once.
 */
private TagModel feedTagStructureToGraph(Tag tag, Set<Tag> visited, int level)
{
  if (visited.contains(tag))
    return this.getUniqueByProperty(TagModel.PROP_NAME, tag.getName(), true);
  visited.add(tag);
  LOG.fine(String.format("Creating TagModel for Tag: %s%s(%d)   '%s'  traits: %s", StringUtils.repeat(' ', level*2),
      tag.getName(), tag.getContainedTags().size(), tag.getTitle(), tag.getTraits()));
  TagModel tagModel = this.create();
  tagModel.setName(tag.getName());
  tagModel.setTitle(tag.getTitle());
  tagModel.setColor(tag.getColor());
  tagModel.setRoot(tag.isPrime());
  tagModel.setPseudo(tag.isPseudo());
  if (null != tag.getTraits())
    tagModel.putAllTraits(tag.getTraits());
  tag.getContainedTags().forEach(tag2 -> {
    TagModel tag2model = feedTagStructureToGraph(tag2, visited, level+1);
    tagModel.addDesignatedTag(tag2model);
  });
  return tagModel;
}
origin: org.jboss.windup.reporting/windup-reporting-impl

final Map<String, Integer> totals   = new HashMap<>();
for (TagModel sectorTag : sectorsHolderTag.getDesignatedTags())
  for (TagModel techTag : sectorTag.getDesignatedTags())
    String tagName = techTag.getName();
origin: windup/windup

/**
 * Translates the placement tags (labels) to their normalized real tag counterparts. Returns a 2-item array; index 0 has the normal names, index 1
 * the placement names.
 *
 * Due to bad design, the rules contain column and row titles for the graph, rather than technology tags. To make them fit into the tag system,
 * this translation is needed. See also the "place:..." tags in the report hierarchy definition.
 */
private static Set<String> getPlacementTags(GraphContext graphContext, Set<String> potentialPlaceTags)
{
  final TagGraphService tagService = new TagGraphService(graphContext);
  Set<String> placeNames = new HashSet<>();
  potentialPlaceTags.forEach(name -> {
    final TagModel placeTag = tagService.getTagByName("place:" + Tag.normalizeName(name));
    if (null != placeTag)
      placeNames.add(placeTag.getName());
  });
  return placeNames;
}
origin: org.jboss.windup.reporting/windup-reporting-api

  /**
   * Returns a single parent of the given tag. If there are multiple parents, throws a WindupException.
   */
  public static TagModel getSingleParent(TagModel tag)
  {
    final Iterator<TagModel> parents = tag.getDesignatedByTags().iterator();
    if (!parents.hasNext())
      throw new WindupException("Tag is not designated by any tags: " + tag);

    final TagModel maybeOnlyParent = parents.next();

    if (parents.hasNext()) {
      StringBuilder sb = new StringBuilder();
      tag.getDesignatedByTags().iterator().forEachRemaining(x -> sb.append(x).append(", "));
      throw new WindupException(String.format("Tag %s is designated by multiple tags: %s", tag, sb.toString()));
    }

    return maybeOnlyParent;
  }
}
origin: windup/windup

/**
 * Creates and returns the TagModel in a graph as per given Tag;
 * recursively creates the designated ("contained") tags.
 * <p>
 * If the Tag was already processed exists, returns the corresponding TagModel.
 * Doesn't check if the TagModel for given tag name already exists, assuming this method is only called once.
 */
private TagModel feedTagStructureToGraph(Tag tag, Set<Tag> visited, int level)
{
  if (visited.contains(tag))
    return this.getUniqueByProperty(TagModel.PROP_NAME, tag.getName(), true);
  visited.add(tag);
  LOG.fine(String.format("Creating TagModel for Tag: %s%s(%d)   '%s'  traits: %s", StringUtils.repeat(' ', level*2),
      tag.getName(), tag.getContainedTags().size(), tag.getTitle(), tag.getTraits()));
  TagModel tagModel = this.create();
  tagModel.setName(tag.getName());
  tagModel.setTitle(tag.getTitle());
  tagModel.setColor(tag.getColor());
  tagModel.setRoot(tag.isPrime());
  tagModel.setPseudo(tag.isPseudo());
  if (null != tag.getTraits())
    tagModel.putAllTraits(tag.getTraits());
  tag.getContainedTags().forEach(tag2 -> {
    TagModel tag2model = feedTagStructureToGraph(tag2, visited, level+1);
    tagModel.addDesignatedTag(tag2model);
  });
  return tagModel;
}
origin: windup/windup

final Map<String, Integer> totals   = new HashMap<>();
for (TagModel sectorTag : sectorsHolderTag.getDesignatedTags())
  for (TagModel techTag : sectorTag.getDesignatedTags())
    String tagName = techTag.getName();
origin: org.jboss.windup.reporting/windup-reporting-impl

/**
 * Translates the placement tags (labels) to their normalized real tag counterparts. Returns a 2-item array; index 0 has the normal names, index 1
 * the placement names.
 *
 * Due to bad design, the rules contain column and row titles for the graph, rather than technology tags. To make them fit into the tag system,
 * this translation is needed. See also the "place:..." tags in the report hierarchy definition.
 */
private static Set<String> getPlacementTags(GraphContext graphContext, Set<String> potentialPlaceTags)
{
  final TagGraphService tagService = new TagGraphService(graphContext);
  Set<String> placeNames = new HashSet<>();
  potentialPlaceTags.forEach(name -> {
    final TagModel placeTag = tagService.getTagByName("place:" + Tag.normalizeName(name));
    if (null != placeTag)
      placeNames.add(placeTag.getName());
  });
  return placeNames;
}
origin: windup/windup

  /**
   * Returns a single parent of the given tag. If there are multiple parents, throws a WindupException.
   */
  public static TagModel getSingleParent(TagModel tag)
  {
    final Iterator<TagModel> parents = tag.getDesignatedByTags().iterator();
    if (!parents.hasNext())
      throw new WindupException("Tag is not designated by any tags: " + tag);

    final TagModel maybeOnlyParent = parents.next();

    if (parents.hasNext()) {
      StringBuilder sb = new StringBuilder();
      tag.getDesignatedByTags().iterator().forEachRemaining(x -> sb.append(x).append(", "));
      throw new WindupException(String.format("Tag %s is designated by multiple tags: %s", tag, sb.toString()));
    }

    return maybeOnlyParent;
  }
}
origin: windup/windup

  throw new IllegalArgumentException("Sub tag param was null. Super tag: " + superTag);
if (superTag.getName().equals(subTag.getName()))
  return true;
  for (TagModel currentTag : currentSet)
    for (TagModel parent : currentTag.getDesignatedByTags()) {
      if (superTag.equals(parent))
        return true;
origin: windup/windup

default String getTitleOrName()
{
  return StringUtils.defaultString(this.getTitle(), this.getName());
}
origin: org.jboss.windup.reporting/windup-reporting-impl

mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), 0L, stat.getName(), stat, false);
mergeToTheRightCell(map, "", placement.box.getName(), 0L, "", stat, true);
  mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), appToCountTowards, stat.getName(), stat, false);
  mergeToTheRightCell(map, "", placement.box.getName(), appToCountTowards, "", stat, false);
origin: windup/windup

private void getDescendantTags(TagModel tag, Set<TagModel> putResultsHere)
{
  for (TagModel childTag : tag.getDesignatedTags())
  {
    if (!putResultsHere.add(childTag))
      continue; // Already visited.
    getDescendantTags(childTag, putResultsHere);
  }
}
origin: org.jboss.windup.reporting/windup-reporting-impl

private static TagModel getNonPlaceParent(TagGraphService tagService, TagModel tag)
{
  if (tag == null)
    return null;
  final TagModel placeRoot = tagService.getTagByName(MAPPING_OF_PLACEMENT_NAMES);
  final Iterator<TagModel> parents = tag.getDesignatedByTags().iterator();
  if (!parents.hasNext())
    throw new WindupException("Tag is not designated by any tags: " + tag);
  TagModel nonPlaceParent = null;
  while (parents.hasNext())
  {
    TagModel parentTag = parents.next();
    if (TagGraphService.isTagUnderTagOrSame(parentTag, placeRoot))
      continue;
    if (nonPlaceParent != null)
      throw new WindupException(
            String.format("Tag %s has more than one non-placement parent: %s, %s", tag.getName(), nonPlaceParent, parentTag));
    nonPlaceParent = parentTag;
  }
  return nonPlaceParent;
}
origin: windup/windup

mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), 0L, stat.getName(), stat, false);
mergeToTheRightCell(map, "", placement.box.getName(), 0L, "", stat, true);
  mergeToTheRightCell(map, placement.row.getName(), placement.box.getName(), appToCountTowards, stat.getName(), stat, false);
  mergeToTheRightCell(map, "", placement.box.getName(), appToCountTowards, "", stat, false);
origin: windup/windup

private static TagModel getNonPlaceParent(TagGraphService tagService, TagModel tag)
{
  if (tag == null)
    return null;
  final TagModel placeRoot = tagService.getTagByName(MAPPING_OF_PLACEMENT_NAMES);
  final Iterator<TagModel> parents = tag.getDesignatedByTags().iterator();
  if (!parents.hasNext())
    throw new WindupException("Tag is not designated by any tags: " + tag);
  TagModel nonPlaceParent = null;
  while (parents.hasNext())
  {
    TagModel parentTag = parents.next();
    if (TagGraphService.isTagUnderTagOrSame(parentTag, placeRoot))
      continue;
    if (nonPlaceParent != null)
      throw new WindupException(
            String.format("Tag %s has more than one non-placement parent: %s, %s", tag.getName(), nonPlaceParent, parentTag));
    nonPlaceParent = parentTag;
  }
  return nonPlaceParent;
}
org.jboss.windup.reporting.modelTagModel

Javadoc

Holds information about a tag, as per the definition from tags.xml files. The TagSetModel and TaggableModel work directly with strings for the sake of simplicity. This is different from TechnologyTagModel. Check the current implementation to see whether or not the whole tag structure is within the graph.

Most used methods

  • getDesignatedByTags
    Which tags is this tag designated by; for instance, "seam" is designated by "web" and "framework:".
  • getDesignatedTags
    Which tags this designates; for instance, "java-ee" designates "ejb" and "jms".
  • getName
    Tag name (ID), preferably kebab-style, e.g "java-ee-6".
  • addDesignatedTag
  • getTitle
    Human readable title of technology this tag represents, e.g "Java EE 6".
  • putAllTraits
    A map of traits - custom tag key-value pairs.
  • setColor
  • setName
  • setPseudo
  • setRoot
  • setTitle
  • setTitle

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now