Class FlowableExpressionFormatUtils


  • public class FlowableExpressionFormatUtils
    extends java.lang.Object
    Expression Bean Name: flwFormatUtils Offers a number of formatting utils, mostly related to numbers, currencies and strings. All methods which accept a language tag must be supplied with a string consisting of the language code and the country, e.g. "ch-DE", "en-US" etc.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String formatCurrencyWithLocale​(java.lang.String currencyCode, double amount, java.lang.String languageTag)
      Formats a currency amount according to the format specified in the locale of the provided language tag.
      java.lang.String formatDate​(java.lang.Object dateObject, java.lang.String dateFormat)
      Formats a Date, Instant, LocalDate or LocalDateTime to a String with the given Format
      java.lang.String formatDecimal​(java.lang.String pattern, double decimal)
      Formats a String according to the Java Formatter specification with a Decimal Formatter in the default locale.
      java.lang.String formatString​(java.lang.String text, java.lang.Object... substitutes)
      Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html
      java.lang.String formatStringWithLocale​(java.lang.String languageTag, java.lang.String text, java.lang.Object... substitutes)
      Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html.
      • Methods inherited from class java.lang.Object

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

      • FlowableExpressionFormatUtils

        public FlowableExpressionFormatUtils()
    • Method Detail

      • formatString

        public java.lang.String formatString​(java.lang.String text,
                                             java.lang.Object... substitutes)
        Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html
        Parameters:
        text - String to be formatted
        substitutes - Objects to be replaced
        Returns:
        Text where all placeholders have been replaced
      • formatDate

        public java.lang.String formatDate​(java.lang.Object dateObject,
                                           java.lang.String dateFormat)
        Formats a Date, Instant, LocalDate or LocalDateTime to a String with the given Format
        Parameters:
        dateObject - Date, Instant, LocalDate or LocalDateTime to convert
        dateFormat - Date Format to be used
        Returns:
        Formatted date
      • formatDecimal

        public java.lang.String formatDecimal​(java.lang.String pattern,
                                              double decimal)
        Formats a String according to the Java Formatter specification with a Decimal Formatter in the default locale. See https://docs.oracle.com/javase/tutorial/java/data/numberformat.html
        Parameters:
        pattern - Decimal Pattern to be used
        decimal - Decimal to be formatted
        Returns:
        Text where all placeholders have been replaced
      • formatStringWithLocale

        public java.lang.String formatStringWithLocale​(java.lang.String languageTag,
                                                       java.lang.String text,
                                                       java.lang.Object... substitutes)
        Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html. The string is formatted according to the format specified in the locale of the provided language tag.
        Parameters:
        languageTag - The language to be used when formatting, e.g. "de-CH"
        text - The text to be formatted
        substitutes - The substitutes in the order of their appearance.
        Returns:
        Text where all placeholders have been replaced
      • formatCurrencyWithLocale

        public java.lang.String formatCurrencyWithLocale​(java.lang.String currencyCode,
                                                         double amount,
                                                         java.lang.String languageTag)
        Formats a currency amount according to the format specified in the locale of the provided language tag.
        Parameters:
        currencyCode - The currency ot be formatted with
        languageTag - The language to be used when formatting, e.g. "de-CH".
        amount - The amount to be formatted
        Returns:
        The formatted currency amount