Class HCHTMLHelper


  • @Immutable
    public final class HCHTMLHelper
    extends Object
    • Method Detail

      • recursiveGetAllChildrenWithTagName

        @Nonnull
        @ReturnsMutableCopy
        public static com.helger.commons.collection.impl.ICommonsList<IHCElement<?>> recursiveGetAllChildrenWithTagName​(@Nonnull
                                                                                                                        IHCNode aOwner,
                                                                                                                        @Nonnull @Nonempty
                                                                                                                        EHTMLElement... aElements)
        Helper method to enforce correct element nesting. See http://www.w3.org/TR/xhtml1#prohibitions
        Parameters:
        aOwner - Owner where to start searching
        aElements - The tag names to search. May not be null.
        Returns:
        All elements with the passed element name on any level. Never null.
      • recursiveGetFirstChildWithDifferentTagName

        @Nullable
        public static IHCElement<?> recursiveGetFirstChildWithDifferentTagName​(@Nonnull
                                                                               IHCNode aOwner,
                                                                               @Nonnull @Nonempty
                                                                               EHTMLElement... aElements)
        Helper method to enforce correct element nesting. See http://www.w3.org/TR/xhtml1#prohibitions
        Parameters:
        aOwner - Owner where to start searching
        aElements - The tag names to search. May not be null.
        Returns:
        The first element with a different than the passed tag name on any level, or null if no such element exists.
      • recursiveContainsChildWithDifferentTagName

        public static boolean recursiveContainsChildWithDifferentTagName​(@Nonnull
                                                                         IHCNode aOwner,
                                                                         @Nonnull @Nonempty
                                                                         EHTMLElement... aElements)
      • recursiveGetFirstChildWithTagName

        @Nullable
        public static IHCElement<?> recursiveGetFirstChildWithTagName​(@Nonnull
                                                                      IHCNode aOwner,
                                                                      @Nonnull @Nonempty
                                                                      EHTMLElement... aElements)
        Helper method to enforce correct element nesting. See http://www.w3.org/TR/xhtml1#prohibitions
        Parameters:
        aOwner - Owner to start searching
        aElements - The tag names to search. May not be null.
        Returns:
        The first element with the passed tag name on any level, or null if no such element exists.