Class FlowableExpressionStringUtils

java.lang.Object
com.flowable.platform.expressions.FlowableExpressionStringUtils

public class FlowableExpressionStringUtils extends Object
Expression Bean Name: flw.string Provides utilities to work with strings. For more formatting-centric functions, see FlowableExpressionFormatUtils.
  • Constructor Details

    • FlowableExpressionStringUtils

      public FlowableExpressionStringUtils()
  • Method Details

    • toUpperCase

      public String toUpperCase(Object text)
      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

      public String toLowerCase(Object text)
      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

      public String capitalize(Object text)
      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

      public String trimWhitespace(Object text)
      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

      public boolean hasText(Object text)
      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

      public boolean contains(Object text, String otherText)
      Checks if a strings contains another string. Supports the following input:
      • String
      • Json TextNode
      • null
      Parameters:
      text - The text to be checked
      otherText - The text that should be contained within the first text
      Returns:
      Whether or not otherText is part of text.
    • containsIgnoreCase

      public boolean containsIgnoreCase(Object text, String otherText)
      Checks if a strings contains another string ignoring the case. Supports the following input:
      • String
      • Json TextNode
      • null
      Parameters:
      text - The text to be checked
      otherText - The text that should be contained within the first text
      Returns:
      Whether or not otherText is part of text.
    • matches

      public boolean matches(Object text, String regularExpression)
      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 check
      regularExpression - The regular expression to check the text against
      Returns:
      Whether or not the text matches the regular expression
    • equals

      public boolean equals(Object text, String otherText)
      Checks if two strings are the same. Supports the following input:
      • String
      • Json TextNode
      • null
      Parameters:
      text - The first text
      otherText - The second text
      Returns:
      Whether or not the two texts are equal.
    • equalsIgnoreCase

      public boolean equalsIgnoreCase(Object text, String otherText)
      Checks if two strings are the same without taking capitalization into account. Supports the following input:
      • String
      • Json TextNode
      • null
      Parameters:
      text - The first text
      otherText - The second text
      Returns:
      Whether or not the two texts are equal.
    • substring

      public String substring(Object text, int from, int to)
      Gets all text between a character range. Supports the following input:
      • String
      • Json TextNode
      • null
      Parameters:
      text - The original text
      from - The offset from the start beginning at 0
      to - The offset from the end beginning at 0
      Returns:
      The string between from and to
    • substringFrom

      public String substringFrom(Object text, int from)
      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 text
      from - The character offset beginning at 0
      Returns:
      The string set off by from
    • split

      public List<String> split(Object text, String delimiter)
      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 split
      delimiter - The splitter to be used
      Returns:
      A list
    • join

      public String join(Collection<String> collection, String delimiter)
      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 object
      delimiter - The separator between the entries, e.g. ", " or " and "
      Returns:
      Joined String
    • newline

      public String newline()
      Returns a newline/linefeed character (\n)
      Returns:
      Newline character
    • carriageReturn

      public String carriageReturn()
      Returns a carriage return character (\r)
      Returns:
      Carriage return character
    • unescapeHtml

      public String unescapeHtml(Object text)
      Unescapes a String 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

      public String escapeHtml(Object text)
      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