@OpenApiAll
public class HtmlTextUtils
extends java.lang.Object
Constructor and Description |
---|
HtmlTextUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encodeHtmlCharacters(java.lang.String text)
Encodes string characters to html characters.
|
static java.lang.String |
endTag(java.lang.String tag)
Create end tag for the given tag.
|
static java.lang.String |
escapeLongSpaces(java.lang.String text)
Replaces sequece of 2 or more spaces with same amount of not breaking spaces.
|
static boolean |
isHtml(java.lang.String text)
Checks if given string is html string - starts with <html> tag
|
static java.lang.String |
removeHtmlBodyPTags(java.lang.String htmlText)
Extracts body from the given html text.
|
static java.lang.String |
removeHtmlBodyTags(java.lang.String htmlText)
Extracts body from the given html text
|
static java.lang.String |
replaceNBSP(java.lang.String text) |
static java.lang.String |
startTag(java.lang.String tag)
Create start tag for the given tag.
|
static java.lang.String |
toHtmlText(java.lang.String text)
Convert given text to html text.
|
static java.lang.String |
toPlainText(javax.swing.text.Document doc)
Converts document to plain text
|
static java.lang.String |
toPlainText(java.lang.String htmlText)
Converts html text to plain text.
|
static java.lang.String |
wrapInHtmlBodyNewLineTags(java.lang.String text)
Wrap given text in <html><body>new_line tags
|
static java.lang.String |
wrapInHtmlBodyPTags(java.lang.String text)
Wrap given text in <html><body><p> tags
|
static java.lang.String |
wrapInHtmlBodyTags(java.lang.String text)
Wrap given text in <html><body> tags
|
static java.lang.String |
wrapInHtmlLightBodyPTags(java.lang.String text)
Wrap given text in <html light="true"><body><p> tags
|
static java.lang.String |
wrapInHtmlLightBodyTags(java.lang.String text)
Wrap given text in <html light="true"><body> tags
|
static java.lang.String |
wrapInHtmlTag(java.lang.String text)
Wrap given text with <html> tag
|
static java.lang.StringBuilder |
wrapInHtmlTag(java.lang.StringBuilder text)
Wrap given text with <html> tag
|
public static boolean isHtml(@CheckForNull java.lang.String text)
text
- textpublic static java.lang.String removeHtmlBodyPTags(java.lang.String htmlText)
htmlText
- html textpublic static java.lang.String removeHtmlBodyTags(java.lang.String htmlText)
htmlText
- html textpublic static java.lang.String wrapInHtmlTag(java.lang.String text)
text
- textpublic static java.lang.StringBuilder wrapInHtmlTag(java.lang.StringBuilder text)
text
- textpublic static java.lang.String wrapInHtmlBodyPTags(java.lang.String text)
text
- textpublic static java.lang.String wrapInHtmlBodyNewLineTags(java.lang.String text)
text
- textpublic static java.lang.String wrapInHtmlBodyTags(java.lang.String text)
text
- textpublic static java.lang.String wrapInHtmlLightBodyTags(java.lang.String text)
text
- textpublic static java.lang.String wrapInHtmlLightBodyPTags(java.lang.String text)
text
- textpublic static java.lang.String startTag(java.lang.String tag)
tag
- The given tag.public static java.lang.String endTag(java.lang.String tag)
tag
- The given tag.public static java.lang.String toHtmlText(java.lang.String text)
text
- the given textpublic static java.lang.String encodeHtmlCharacters(java.lang.String text)
text
- plain textpublic static java.lang.String toPlainText(java.lang.String htmlText)
htmlText
- html textpublic static java.lang.String toPlainText(javax.swing.text.Document doc)
public static java.lang.String escapeLongSpaces(java.lang.String text)
public static java.lang.String replaceNBSP(java.lang.String text)