Package com.helger.html.hc.ext
Class HCExtHelper
- java.lang.Object
-
- com.helger.html.hc.ext.HCExtHelper
-
@Immutable public final class HCExtHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHCExtHelper.ILineConsumer
-
Field Summary
Fields Modifier and Type Field Description static charPATTERN_NEWLINEstatic intPATTERN_NEWLINE_LENGTH
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IHCElement<?>createHCElement(EHTMLElement eElement)static IHCElement<?>createHCElementFromName(String sTagName)static voidforEachLine(String sText, HCExtHelper.ILineConsumer aTarget)static <SRCTYPE> com.helger.commons.collection.impl.ICommonsList<IHCNode>list2brList(Iterable<? extends SRCTYPE> aCont, Function<? super SRCTYPE,String> aMapper)static com.helger.commons.collection.impl.ICommonsList<IHCNode>list2brList(Iterable<String> aCont)static <SRCTYPE> com.helger.commons.collection.impl.ICommonsList<IHCNode>list2divList(Iterable<? extends SRCTYPE> aCont, Function<? super SRCTYPE,String> aMapper)static com.helger.commons.collection.impl.ICommonsList<IHCNode>list2divList(Iterable<String> aCont)static com.helger.commons.collection.impl.ICommonsList<IHCNode>nl2brList(String sText)static voidnl2brList(String sText, Consumer<? super IHCNode> aTarget)static HCNodeListnl2brNodeList(String sText)static com.helger.commons.collection.impl.ICommonsList<HCDiv>nl2divList(String sText)Convert the passed text to a list of <div> elements.static voidnl2divList(String sText, Consumer<? super HCDiv> aTarget)Convert the passed text to a list of <div> elements.static HCNodeListnl2divNodeList(String sText)Convert the passed text to a list of <div> elements.
-
-
-
Field Detail
-
PATTERN_NEWLINE
public static final char PATTERN_NEWLINE
- See Also:
- Constant Field Values
-
PATTERN_NEWLINE_LENGTH
public static final int PATTERN_NEWLINE_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
createHCElement
@Nullable public static IHCElement<?> createHCElement(@Nullable EHTMLElement eElement)
-
createHCElementFromName
@Nullable public static IHCElement<?> createHCElementFromName(@Nullable String sTagName)
-
forEachLine
public static void forEachLine(@Nullable String sText, @Nonnull HCExtHelper.ILineConsumer aTarget)
-
nl2brList
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<IHCNode> nl2brList(@Nullable String sText)
-
nl2brNodeList
@Nonnull @ReturnsMutableCopy public static HCNodeList nl2brNodeList(@Nullable String sText)
-
nl2brList
public static void nl2brList(@Nullable String sText, @Nonnull Consumer<? super IHCNode> aTarget)
-
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\nworldresults in 2 <div>s: <div>Hello</div> and <div>world</div>- Parameters:
sText- The text to be split. May benull.- Returns:
- A non-
nullbut 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\nworldresults in 2 <div>s: <div>Hello</div> and <div>world</div>- Parameters:
sText- The text to be split. May benull.- Returns:
- A non-
nullbut 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\nworldresults in 2 <div>s: <div>Hello</div> and <div>world</div>- Parameters:
sText- The text to be split. May benull.aTarget- The consumer to be invoked with everyHCDiv. May not benull.
-
list2brList
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<IHCNode> list2brList(@Nullable Iterable<String> aCont)
-
list2brList
@Nonnull @ReturnsMutableCopy public static <SRCTYPE> com.helger.commons.collection.impl.ICommonsList<IHCNode> list2brList(@Nullable Iterable<? extends SRCTYPE> aCont, @Nonnull Function<? super SRCTYPE,String> aMapper)
-
list2divList
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<IHCNode> list2divList(@Nullable Iterable<String> aCont)
-
-