Class FlowableExpressionStringUtils
java.lang.Object
com.flowable.platform.expressions.FlowableExpressionStringUtils
Expression Bean Name: flw.string
Provides utilities to work with strings. For more formatting-centric functions, see
FlowableExpressionFormatUtils
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncapitalize
(Object text) Capitalizes a text, i.e.Returns a carriage return character (\r)boolean
Checks if a strings contains another string.boolean
containsIgnoreCase
(Object text, String otherText) Checks if a strings contains another string ignoring the case.boolean
Checks if two strings are the same.boolean
equalsIgnoreCase
(Object text, String otherText) Checks if two strings are the same without taking capitalization into account.escapeHtml
(Object text) Escapes the characters in an object using HTML entities.boolean
Checks whether a string contains text (is not null, empty) Supports the following input: String Json TextNodenull
join
(Collection<String> collection, String delimiter) Concatenates all entries of a list or collection to a single string.boolean
Checks whether a text matches a regular expression.newline()
Returns a newline/linefeed character (\n)Splits a text into a collection with a given delimiter.Gets all text between a character range.substringFrom
(Object text, int from) Gets all text behind a certain character.toLowerCase
(Object text) Turns all letters of an object to lowercase.toUpperCase
(Object text) Turns all letters of an object to uppercase.trimWhitespace
(Object text) Deletes all whitespaces from a text Supports the following input: String Json TextNodenull
unescapeHtml
(Object text) Unescapes aString
containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.
-
Constructor Details
-
FlowableExpressionStringUtils
public FlowableExpressionStringUtils()
-
-
Method Details
-
toUpperCase
Turns all letters of an object to uppercase. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be converted to uppercase- Returns:
- The text, converted to uppercase
-
toLowerCase
Turns all letters of an object to lowercase. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be converted to lowercase- Returns:
- The text, converted to lowercase
-
capitalize
Capitalizes a text, i.e. sets the first letter to uppercase. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be capitalized- Returns:
- The capitalized text
-
trimWhitespace
Deletes all whitespaces from a text Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be trimmed- Returns:
- The trimmed text
-
hasText
Checks whether a string contains text (is not null, empty) Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be checked- Returns:
- Whether or not the text contains any text
-
contains
Checks if a strings contains another string. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be checkedotherText
- The text that should be contained within the first text- Returns:
- Whether or not
otherText
is part oftext
.
-
containsIgnoreCase
Checks if a strings contains another string ignoring the case. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be checkedotherText
- The text that should be contained within the first text- Returns:
- Whether or not
otherText
is part oftext
.
-
matches
Checks whether a text matches a regular expression. Example: #{flwStringUtils.matches('CHF 1000', 'CHF \d*'))} = true Example: #{flwStringUtils.matches('EUR 1000', 'CHF \d*'))} = false Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to checkregularExpression
- The regular expression to check the text against- Returns:
- Whether or not the text matches the regular expression
-
equals
Checks if two strings are the same. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The first textotherText
- The second text- Returns:
- Whether or not the two texts are equal.
-
equalsIgnoreCase
Checks if two strings are the same without taking capitalization into account. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The first textotherText
- The second text- Returns:
- Whether or not the two texts are equal.
-
substring
Gets all text between a character range. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The original textfrom
- The offset from the start beginning at 0to
- The offset from the end beginning at 0- Returns:
- The string between from and to
-
substringFrom
Gets all text behind a certain character. Please note that the parameter is zero-based. Example: #{flwStringUtils.substringFrom("hello", 0) = "hello" Example: #{flwStringUtils.substringFrom("hello", 1) = "ello" Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The original textfrom
- The character offset beginning at 0- Returns:
- The string set off by from
-
split
Splits a text into a collection with a given delimiter. The delimiter can be a single character, e.g. a semicolon or a regular expression. If there is no delimiter available then empty space is used. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be splitdelimiter
- The splitter to be used- Returns:
- A list
-
join
Concatenates all entries of a list or collection to a single string. Example: #{flwStringUtils.join(customers, ', '}}- Parameters:
collection
- A collection, list or any other iterable objectdelimiter
- The separator between the entries, e.g. ", " or " and "- Returns:
- Joined String
-
newline
Returns a newline/linefeed character (\n)- Returns:
- Newline character
-
carriageReturn
Returns a carriage return character (\r)- Returns:
- Carriage return character
-
unescapeHtml
Unescapes aString
containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. For instance, in a text containing the character '™' would be unescaped to '™'. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be unescaped- Returns:
- The unescaped text
-
escapeHtml
Escapes the characters in an object using HTML entities. For instance, in a text containing the character '™' would be escaped to '™'. Supports the following input:- String
- Json TextNode
null
- Parameters:
text
- The text to be escaped- Returns:
- The escaped text
-