Class TagHelper

java.lang.Object
org.ametys.cms.tag.TagHelper

public final class TagHelper extends Object
Helper class which provides useful methods to operate on Tag objects.
  • Method Details

    • getDescendants

      public static Set<Tag> getDescendants(Tag tag, boolean includeCurrent)
      Retrieves all descendants (direct and non-direct children) of the current tag.
      Parameters:
      tag - the current tag
      includeCurrent - true to include the current tag itself
      Returns:
      the set of descendant tags.
    • getDescendantNames

      public static Set<String> getDescendantNames(Tag tag, boolean includeCurrent)
      Retrieves all name of the descendants (direct and non-direct children) of the current tag.
      Parameters:
      tag - the current tag
      includeCurrent - true to include the current tag itself
      Returns:
      the set of descendant tag names
    • getAncestors

      public static Set<Tag> getAncestors(Tag tag, boolean includeCurrent)
      Retrieves all ancestors of the current tag.
      Parameters:
      tag - the current tag
      includeCurrent - true to include the current tag itself
      Returns:
      the set of ancestor tags.
    • getAncestorNames

      public static Set<String> getAncestorNames(Tag tag, boolean includeCurrent)
      Retrieves all name of the ancestors of the current tag.
      Parameters:
      tag - the current tag
      includeCurrent - true to include the current tag itself
      Returns:
      the set of ancestor tag names