Class HCExtHelper


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

      • nl2brList

        @Nonnull
        @ReturnsMutableCopy
        public static com.helger.commons.collection.impl.ICommonsList<IHCNode> nl2brList​(@Nullable
                                                                                         String sText)
      • nl2divList

        @Nonnull
        @ReturnsMutableCopy
        public static com.helger.commons.collection.impl.ICommonsList<HCDiv> nl2divList​(@Nullable
                                                                                        String sText)
        Convert the passed text to a list of <div> elements. Each \n is used to split the text into separate lines. \r characters are removed from the string! Empty lines are preserved except for the last line. E.g. Hello\nworld results in 2 <div>s: <div>Hello</div> and <div>world</div>
        Parameters:
        sText - The text to be split. May be null.
        Returns:
        A non-null but maybe empty list. The list is empty, if the string is empty.
      • nl2divNodeList

        @Nonnull
        @ReturnsMutableCopy
        public static HCNodeList nl2divNodeList​(@Nullable
                                                String sText)
        Convert the passed text to a list of <div> elements. Each \n is used to split the text into separate lines. \r characters are removed from the string! Empty lines are preserved except for the last line. E.g. Hello\nworld results in 2 <div>s: <div>Hello</div> and <div>world</div>
        Parameters:
        sText - The text to be split. May be null.
        Returns:
        A non-null but maybe empty list. The list is empty, if the string is empty.
      • nl2divList

        public static void nl2divList​(@Nullable
                                      String sText,
                                      @Nonnull
                                      Consumer<? super HCDiv> aTarget)
        Convert the passed text to a list of <div> elements. Each \n is used to split the text into separate lines. \r characters are removed from the string! Empty lines are preserved except for the last line. E.g. Hello\nworld results in 2 <div>s: <div>Hello</div> and <div>world</div>
        Parameters:
        sText - The text to be split. May be null.
        aTarget - The consumer to be invoked with every HCDiv. May not be null.