Interface IFormatService

  • All Known Implementing Classes:
    FormatService

    public interface IFormatService
    Facade to format values of number, date/time and boolean types. Service is based on ICU formats with special V8 format settings.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static IFormatService INSTANCE
      Format service instance.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String format​(boolean trueFalse)
      Formats boolean value with com._1c.g5.v8.dt.core.format.impl.BooleanFormat with default ICU locale.
      String format​(boolean trueFalse, com.ibm.icu.util.ULocale locale)
      Formats boolean value with com._1c.g5.v8.dt.core.format.impl.BooleanFormat with selected ICU locale.
      String format​(boolean trueFalse, String formatString)
      Formats boolean value with format based on com._1c.g5.v8.dt.core.format.impl.BooleanFormat with default ICU locale and additional settings in selected V8 format string.
      String format​(BigDecimal number)
      Formats number with pure DecimalFormat with default ICU locale.
      String format​(BigDecimal number, com.ibm.icu.util.ULocale locale)
      Formats number with pure DecimalFormat with selected ICU locale.
      String format​(BigDecimal number, String formatString)
      Formats number with format based on DecimalFormat with default ICU locale and additional settings in selected V8 format string.
      String format​(Date dateTime)
      Formats date and time with adjusted SimpleDateFormat with default ICU locale (yy -> yyyy).
      String format​(Date dateTime, com.ibm.icu.util.ULocale locale)
      Formats date and time with adjusted SimpleDateFormat with selected ICU locale (yy -> yyyy).
      String format​(Date dateTime, String formatString)
      Formats date and time with format based on adjusted com._1c.g5.v8.dt.core.format.impl.BooleanFormat with default ICU locale and additional settings in selected V8 format string.
      String getDateFormatPattern()  
      String getDateTimeFormatPattern()  
      com.ibm.icu.util.ULocale getNumberAndDateLocale()
      Gets number and date format locale.
      com.ibm.icu.util.ULocale getResourcesLocale()
      Gets resources locale.
      String getTimeFormatPattern()  
      Map<FormatStringParameter,​String> parseFormatString​(String formatString)
      Parses a given formatString.
    • Field Detail

      • INSTANCE

        static final IFormatService INSTANCE
        Format service instance.
    • Method Detail

      • format

        String format​(BigDecimal number)
        Formats number with pure DecimalFormat with default ICU locale.
        Parameters:
        number - the number
        Returns:
        formatted number
      • format

        String format​(BigDecimal number,
                      String formatString)
        Formats number with format based on DecimalFormat with default ICU locale and additional settings in selected V8 format string.
        Parameters:
        number - the number
        locale - the locale
        Returns:
        formatted number
      • format

        String format​(BigDecimal number,
                      com.ibm.icu.util.ULocale locale)
        Formats number with pure DecimalFormat with selected ICU locale.
        Parameters:
        number - the number
        locale - the locale
        Returns:
        formatted number
      • format

        String format​(boolean trueFalse)
        Formats boolean value with com._1c.g5.v8.dt.core.format.impl.BooleanFormat with default ICU locale.
        Parameters:
        trueFalse - the boolean
        Returns:
        formatted boolean
      • format

        String format​(boolean trueFalse,
                      String formatString)
        Formats boolean value with format based on com._1c.g5.v8.dt.core.format.impl.BooleanFormat with default ICU locale and additional settings in selected V8 format string.
        Parameters:
        trueFalse - the boolean
        locale - the locale
        Returns:
        formatted boolean
      • format

        String format​(boolean trueFalse,
                      com.ibm.icu.util.ULocale locale)
        Formats boolean value with com._1c.g5.v8.dt.core.format.impl.BooleanFormat with selected ICU locale.
        Parameters:
        trueFalse - the boolean
        locale - the locale
        Returns:
        formatted boolean
      • format

        String format​(Date dateTime)
        Formats date and time with adjusted SimpleDateFormat with default ICU locale (yy -> yyyy).
        Parameters:
        dateTime - the date and time
        Returns:
        formatted date and time
      • format

        String format​(Date dateTime,
                      String formatString)
        Formats date and time with format based on adjusted com._1c.g5.v8.dt.core.format.impl.BooleanFormat with default ICU locale and additional settings in selected V8 format string.
        Parameters:
        dateTime - the date and time
        locale - the locale
        Returns:
        formatted date and time
      • format

        String format​(Date dateTime,
                      com.ibm.icu.util.ULocale locale)
        Formats date and time with adjusted SimpleDateFormat with selected ICU locale (yy -> yyyy).
        Parameters:
        dateTime - the date and time
        locale - the locale
        Returns:
        formatted date and time
      • getNumberAndDateLocale

        com.ibm.icu.util.ULocale getNumberAndDateLocale()
        Gets number and date format locale. By default is system locale, but may be specified in command line arg '/VL'.
        Returns:
        number and date format locale
      • getResourcesLocale

        com.ibm.icu.util.ULocale getResourcesLocale()
        Gets resources locale. By default is system locale? but may be specified in command line arg '/L'
        Returns:
        resources locale
      • parseFormatString

        Map<FormatStringParameter,​String> parseFormatString​(String formatString)
        Parses a given formatString.
        Parameters:
        formatString - format string to parse.
        Returns:
        parsed format string parameters.
      • getTimeFormatPattern

        String getTimeFormatPattern()
        Returns:
        default time format pattern.
      • getDateFormatPattern

        String getDateFormatPattern()
        Returns:
        default date format pattern.
      • getDateTimeFormatPattern

        String getDateTimeFormatPattern()
        Returns:
        default date time format pattern.