Class TagHelper


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

      • getDescendants

        public static Set<TaggetDescendants​(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<StringgetDescendantNames​(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<TaggetAncestors​(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<StringgetAncestorNames​(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