Modifier and Type | Field and Description |
---|---|
static String |
AMP |
static String |
AMP_XML |
static Charset |
CHARSET_UTF8
The UTF-8 charset constant.
|
static Pattern |
HTML_REMOVE_PATTERN |
static String |
HTML_REMOVE_REGEX |
static String |
HTTP_PREFIX |
static String |
HTTPS_PREFIX |
static String |
LINE_SEPARATOR |
static String |
LIST_DELIMITERS
Common string list delimiters.
|
static String |
NB_SPACE |
Modifier and Type | Method and Description |
---|---|
static String |
arrayToString(Object[] array)
Converts an array to the string.
|
static String |
checkInput(String str)
Checks an input - it escapes the input for HTML and JavaScript.
|
static List<Integer> |
convertCommaSeparatedNumbersToList(String str)
|
static String |
convertListToCommaSeparatedString(List<?> list)
Convert a
List to a comma-separated string. |
static CharSequence |
escapeMarkup(CharSequence s)
This code was copied from Apache Wicket.
|
static CharSequence |
escapeMarkup(CharSequence s,
boolean escapeSpaces)
This code was copied from Apache Wicket.
|
static CharSequence |
escapeMarkup(CharSequence s,
boolean escapeSpaces,
boolean convertToHtmlUnicodeEscapes)
This code was copied from Apache Wicket.
|
static String |
fm(String message,
Object... values)
Substitutes all places of the message using a values.
|
static int |
indexOf(CharSequence input,
char c) |
static int |
indexOf(CharSequence input,
String text) |
static boolean |
isAbsoluteUrl(String url)
Returns true if url address starts with 'http://' or 'https://'.
|
static boolean |
isBlank(CharSequence c) |
static boolean |
isEmpty(CharSequence c) |
static boolean |
isNotBlank(CharSequence c) |
static boolean |
isNotEmpty(CharSequence c) |
static CharSequence |
removeHtml(String str)
Removes the HTML sequences from an input string.
|
static StringBuilder |
removeLastCharacter(StringBuilder sb,
char c)
Removes last character from a builder if exists.
|
static StringBuilder |
removeLastComma(StringBuilder sb)
Removes last character ',' from a builder if exists.
|
static CharSequence |
replaceAll(CharSequence s,
CharSequence searchFor,
CharSequence replaceWith)
Replace all occurrences of one string replaceWith another string.
|
static String |
toExternalUrl(String url)
Prefixes url with 'http://' if not absolute url already.
|
static String[] |
tokenizeStringList(String list)
Tokenizes the given string list into an array of strings.
|
static String |
toString(CharSequence c) |
static CharSequence |
trim(CharSequence input) |
public static final String HTML_REMOVE_REGEX
public static final Pattern HTML_REMOVE_PATTERN
public static final String LINE_SEPARATOR
public static final String NB_SPACE
public static final String HTTP_PREFIX
public static final String HTTPS_PREFIX
public static final String AMP
public static final String AMP_XML
public static final String LIST_DELIMITERS
public static final Charset CHARSET_UTF8
@Nullable public static CharSequence removeHtml(@Nullable String str)
str
- the input string@Nullable public static String toExternalUrl(@Nullable String url)
url
- urlpublic static boolean isAbsoluteUrl(@Nullable String url)
url
- urlpublic static List<Integer> convertCommaSeparatedNumbersToList(@Nullable String str)
str
- the string to be parsedpublic static String convertListToCommaSeparatedString(@Nullable List<?> list)
List
to a comma-separated string.list
- the listpublic static String arrayToString(Object[] array)
array
- the array that has to be convertedpublic static String fm(String message, Object... values)
MessageFormatter
for more detail.message
- the message with places defined as {}values
- an array of values that are used to substitute formatting places of the messagepublic static StringBuilder removeLastComma(StringBuilder sb)
sb
- string builderpublic static StringBuilder removeLastCharacter(StringBuilder sb, char c)
sb
- string builderc
- the the character to be removedpublic static CharSequence escapeMarkup(CharSequence s)
s
- the string to escapeescapeMarkup(CharSequence, boolean)
public static CharSequence escapeMarkup(CharSequence s, boolean escapeSpaces)
s
- the string to escapeescapeSpaces
- true to replace ' ' with nonbreaking spacepublic static CharSequence escapeMarkup(CharSequence s, boolean escapeSpaces, boolean convertToHtmlUnicodeEscapes)
s
- the string to escapeescapeSpaces
- true to replace ' ' with nonbreaking spaceconvertToHtmlUnicodeEscapes
- true to convert non-7 bit characters to unicode HTML (...)public static String[] tokenizeStringList(@Nullable String list)
list
- the string list to be tokenizednull
list)LIST_DELIMITERS
public static int indexOf(CharSequence input, String text)
input
- the inputtext
- the searched textpublic static int indexOf(CharSequence input, char c)
input
- the inputc
- the searched character@Nullable public static CharSequence trim(@Nullable CharSequence input)
input
- the CharSequence
to be trimmedpublic static boolean isEmpty(@Nullable CharSequence c)
public static boolean isNotEmpty(@Nullable CharSequence c)
public static boolean isBlank(@Nullable CharSequence c)
public static boolean isNotBlank(@Nullable CharSequence c)
@Nullable public static String toString(@Nullable CharSequence c)
public static CharSequence replaceAll(CharSequence s, CharSequence searchFor, CharSequence replaceWith)
s
- The string to processsearchFor
- The value to search forreplaceWith
- The value to searchFor replaceWithCopyright © 2016. All rights reserved.