public class HtmlParserUtil
extends java.lang.Object
| Constructor and Description |
|---|
HtmlParserUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
extractText(java.lang.String html)
Extracts the raw text from the HTML input, compressing its whitespace and
removing all attributes, scripts, and styles.
|
static java.lang.String |
findAttributeValue(java.util.function.Predicate<java.util.function.Function<java.lang.String,java.lang.String>> findValuePredicate,
java.util.function.Function<java.util.function.Function<java.lang.String,java.lang.String>,java.lang.String> returnValueFunction,
java.lang.String html,
java.lang.String startTagName) |
static java.lang.String |
render(java.lang.String html)
Renders the HTML content into text.
|
public static java.lang.String extractText(java.lang.String html)
For example, raw text returned by this method can be stored in a search index.
html - the HTML textnull if the
HTML input is nullpublic static java.lang.String findAttributeValue(java.util.function.Predicate<java.util.function.Function<java.lang.String,java.lang.String>> findValuePredicate,
java.util.function.Function<java.util.function.Function<java.lang.String,java.lang.String>,java.lang.String> returnValueFunction,
java.lang.String html,
java.lang.String startTagName)
public static java.lang.String render(java.lang.String html)
Using the default settings, the output complies with the
Text/Plain; Format=Flowed (DelSp=No) protocol described in
RFC-3676.
html - the HTML textnull if the HTML text is
null