Package com._1c.g5.v8.dt.core.format
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 withcom._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 withcom._1c.g5.v8.dt.core.format.impl.BooleanFormat
with selected ICU locale.String
format(boolean trueFalse, String formatString)
Formats boolean value with format based oncom._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 pureDecimalFormat
with default ICU locale.String
format(BigDecimal number, com.ibm.icu.util.ULocale locale)
Formats number with pureDecimalFormat
with selected ICU locale.String
format(BigDecimal number, String formatString)
Formats number with format based onDecimalFormat
with default ICU locale and additional settings in selected V8 format string.String
format(Date dateTime)
Formats date and time with adjustedSimpleDateFormat
with default ICU locale (yy -> yyyy).String
format(Date dateTime, com.ibm.icu.util.ULocale locale)
Formats date and time with adjustedSimpleDateFormat
with selected ICU locale (yy -> yyyy).String
format(Date dateTime, String formatString)
Formats date and time with format based on adjustedcom._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 givenformatString
.
-
-
-
Field Detail
-
INSTANCE
static final IFormatService INSTANCE
Format service instance.
-
-
Method Detail
-
format
String format(BigDecimal number)
Formats number with pureDecimalFormat
with default ICU locale.- Parameters:
number
- the number- Returns:
- formatted number
-
format
String format(BigDecimal number, String formatString)
Formats number with format based onDecimalFormat
with default ICU locale and additional settings in selected V8 format string.- Parameters:
number
- the numberlocale
- the locale- Returns:
- formatted number
-
format
String format(BigDecimal number, com.ibm.icu.util.ULocale locale)
Formats number with pureDecimalFormat
with selected ICU locale.- Parameters:
number
- the numberlocale
- the locale- Returns:
- formatted number
-
format
String format(boolean trueFalse)
Formats boolean value withcom._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 oncom._1c.g5.v8.dt.core.format.impl.BooleanFormat
with default ICU locale and additional settings in selected V8 format string.- Parameters:
trueFalse
- the booleanlocale
- the locale- Returns:
- formatted boolean
-
format
String format(boolean trueFalse, com.ibm.icu.util.ULocale locale)
Formats boolean value withcom._1c.g5.v8.dt.core.format.impl.BooleanFormat
with selected ICU locale.- Parameters:
trueFalse
- the booleanlocale
- the locale- Returns:
- formatted boolean
-
format
String format(Date dateTime)
Formats date and time with adjustedSimpleDateFormat
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 adjustedcom._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 timelocale
- the locale- Returns:
- formatted date and time
-
format
String format(Date dateTime, com.ibm.icu.util.ULocale locale)
Formats date and time with adjustedSimpleDateFormat
with selected ICU locale (yy -> yyyy).- Parameters:
dateTime
- the date and timelocale
- 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 givenformatString
.- 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.
-
-