Class FlowableExpressionStringUtils


  • public class FlowableExpressionStringUtils
    extends java.lang.Object
    Expression Bean Name: flwStringUtils Provides utilities to work with strings. For more formatting-centric functions, see FlowableExpressionFormatUtils.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String capitalize​(java.lang.String text)
      Capitalizes a text, i.e.
      java.lang.String carriageReturn()
      Returns a carriage return character (\r)
      boolean contains​(java.lang.String text, java.lang.String otherText)
      Checks if a strings contains another string.
      boolean containsIgnoreCase​(java.lang.String text, java.lang.String otherText)
      Checks if a strings contains another string ignoring the case.
      boolean equals​(java.lang.String text, java.lang.String otherText)
      Checks if two strings are the same.
      boolean equalsIgnoreCase​(java.lang.String text, java.lang.String otherText)
      Checks if two strings are the same without taking capitalization into account.
      java.lang.String escapeHtml​(java.lang.String text)
      Escapes the characters in a String using HTML entities.
      boolean hasText​(java.lang.String text)
      Checks whether a string contains text (is not null, empty)
      java.lang.String join​(java.util.Collection<java.lang.String> collection, java.lang.String delimiter)
      Concatenates all entries of a list or collection to a single string.
      boolean matches​(java.lang.String text, java.lang.String regularExpression)
      Checks whether a text matches a regular expression.
      java.lang.String newline()
      Returns a newline/linefeed character (\n)
      java.util.List<java.lang.String> split​(java.lang.String text, java.lang.String delimiter)
      Splits a text into a collection with a given delimiter.
      java.lang.String substring​(java.lang.String text, int from, int to)
      Gets all text between a character range.
      java.lang.String substringFrom​(java.lang.String text, int from)
      Gets all text behind a certain character.
      java.lang.String toLowerCase​(java.lang.String text)
      Turns all letters of a text to lowercase.
      java.lang.String toUpperCase​(java.lang.String text)
      Turns all letters of a text to uppercase.
      java.lang.String trimWhitespace​(java.lang.String text)
      Deletes all whitespaces from a text
      java.lang.String unescapeHtml​(java.lang.String text)
      Unescapes a String containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlowableExpressionStringUtils

        public FlowableExpressionStringUtils()
    • Method Detail

      • toUpperCase

        public java.lang.String toUpperCase​(java.lang.String text)
        Turns all letters of a text to uppercase.
        Parameters:
        text - The text to be converted to uppercase
        Returns:
        The text, converted to uppercase
      • toLowerCase

        public java.lang.String toLowerCase​(java.lang.String text)
        Turns all letters of a text to lowercase.
        Parameters:
        text - The text to be converted to lowercase
        Returns:
        The text, converted to lowercase
      • capitalize

        public java.lang.String capitalize​(java.lang.String text)
        Capitalizes a text, i.e. sets the first letter to uppercase.
        Parameters:
        text - The text to be capitalized
        Returns:
        The capitalized text
      • trimWhitespace

        public java.lang.String trimWhitespace​(java.lang.String text)
        Deletes all whitespaces from a text
        Parameters:
        text - The text to be trimmed
        Returns:
        The trimmed text
      • hasText

        public boolean hasText​(java.lang.String text)
        Checks whether a string contains text (is not null, empty)
        Parameters:
        text - The text to be checked
        Returns:
        Whether or not the text contains any text
      • contains

        public boolean contains​(java.lang.String text,
                                java.lang.String otherText)
        Checks if a strings contains another string.
        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​(java.lang.String text,
                                          java.lang.String otherText)
        Checks if a strings contains another string ignoring the case.
        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​(java.lang.String text,
                               java.lang.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
        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​(java.lang.String text,
                              java.lang.String otherText)
        Checks if two strings are the same. Consider using == instead.
        Parameters:
        text - The first text
        otherText - The second text
        Returns:
        Whether or not the two texts are equal.
      • equalsIgnoreCase

        public boolean equalsIgnoreCase​(java.lang.String text,
                                        java.lang.String otherText)
        Checks if two strings are the same without taking capitalization into account.
        Parameters:
        text - The first text
        otherText - The second text
        Returns:
        Whether or not the two texts are equal.
      • substring

        public java.lang.String substring​(java.lang.String text,
                                          int from,
                                          int to)
        Gets all text between a character range.
        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 java.lang.String substringFrom​(java.lang.String 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"
        Parameters:
        text - The original text
        from - The character offset beginning at 0
        Returns:
        The string set off by from
      • split

        public java.util.List<java.lang.String> split​(java.lang.String text,
                                                      java.lang.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, a list with a single element will be returned.
        Parameters:
        text - The text to be split
        delimiter - The splitter to be used
        Returns:
        A list
      • join

        public java.lang.String join​(java.util.Collection<java.lang.String> collection,
                                     java.lang.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 java.lang.String newline()
        Returns a newline/linefeed character (\n)
        Returns:
        Newline character
      • carriageReturn

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

        public java.lang.String unescapeHtml​(java.lang.String 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 '™'.
        Parameters:
        text - The text to be unescaped
        Returns:
        The unescaped text
      • escapeHtml

        public java.lang.String escapeHtml​(java.lang.String text)
        Escapes the characters in a String using HTML entities. For instance, in a text containing the character '™' would be escaped to '™'.
        Parameters:
        text - The text to be escaped
        Returns:
        The escaped text