Class FormatService
- java.lang.Object
-
- com._1c.g5.v8.dt.core.format.impl.FormatService
-
- All Implemented Interfaces:
IFormatService
public final class FormatService extends Object implements IFormatService
IFormatService
implementation.
-
-
Field Summary
-
Fields inherited from interface com._1c.g5.v8.dt.core.format.IFormatService
INSTANCE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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()
static IFormatService
init()
Inits format service.Map<FormatStringParameter,String>
parseFormatString(String formatString)
Parses a givenformatString
.
-
-
-
Method Detail
-
init
public static IFormatService init()
Inits format service.- Returns:
- format service instance.
-
format
public String format(BigDecimal number)
Description copied from interface:IFormatService
Formats number with pureDecimalFormat
with default ICU locale.- Specified by:
format
in interfaceIFormatService
- Parameters:
number
- the number- Returns:
- formatted number
-
format
public String format(BigDecimal number, String formatString)
Description copied from interface:IFormatService
Formats number with format based onDecimalFormat
with default ICU locale and additional settings in selected V8 format string.- Specified by:
format
in interfaceIFormatService
- Parameters:
number
- the number- Returns:
- formatted number
-
format
public String format(BigDecimal number, com.ibm.icu.util.ULocale locale)
Description copied from interface:IFormatService
Formats number with pureDecimalFormat
with selected ICU locale.- Specified by:
format
in interfaceIFormatService
- Parameters:
number
- the numberlocale
- the locale- Returns:
- formatted number
-
format
public String format(boolean trueFalse)
Description copied from interface:IFormatService
Formats boolean value withcom._1c.g5.v8.dt.core.format.impl.BooleanFormat
with default ICU locale.- Specified by:
format
in interfaceIFormatService
- Parameters:
trueFalse
- the boolean- Returns:
- formatted boolean
-
format
public String format(boolean trueFalse, String formatString)
Description copied from interface:IFormatService
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.- Specified by:
format
in interfaceIFormatService
- Parameters:
trueFalse
- the boolean- Returns:
- formatted boolean
-
format
public String format(boolean trueFalse, com.ibm.icu.util.ULocale locale)
Description copied from interface:IFormatService
Formats boolean value withcom._1c.g5.v8.dt.core.format.impl.BooleanFormat
with selected ICU locale.- Specified by:
format
in interfaceIFormatService
- Parameters:
trueFalse
- the booleanlocale
- the locale- Returns:
- formatted boolean
-
format
public String format(Date dateTime)
Description copied from interface:IFormatService
Formats date and time with adjustedSimpleDateFormat
with default ICU locale (yy -> yyyy).- Specified by:
format
in interfaceIFormatService
- Parameters:
dateTime
- the date and time- Returns:
- formatted date and time
-
format
public String format(Date dateTime, String formatString)
Description copied from interface:IFormatService
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.- Specified by:
format
in interfaceIFormatService
- Parameters:
dateTime
- the date and time- Returns:
- formatted date and time
-
format
public String format(Date dateTime, com.ibm.icu.util.ULocale locale)
Description copied from interface:IFormatService
Formats date and time with adjustedSimpleDateFormat
with selected ICU locale (yy -> yyyy).- Specified by:
format
in interfaceIFormatService
- Parameters:
dateTime
- the date and timelocale
- the locale- Returns:
- formatted date and time
-
getNumberAndDateLocale
public com.ibm.icu.util.ULocale getNumberAndDateLocale()
Description copied from interface:IFormatService
Gets number and date format locale. By default is system locale, but may be specified in command line arg '/VL'.- Specified by:
getNumberAndDateLocale
in interfaceIFormatService
- Returns:
- number and date format locale
-
getResourcesLocale
public com.ibm.icu.util.ULocale getResourcesLocale()
Description copied from interface:IFormatService
Gets resources locale. By default is system locale? but may be specified in command line arg '/L'- Specified by:
getResourcesLocale
in interfaceIFormatService
- Returns:
- resources locale
-
parseFormatString
public Map<FormatStringParameter,String> parseFormatString(String formatString)
Description copied from interface:IFormatService
Parses a givenformatString
.- Specified by:
parseFormatString
in interfaceIFormatService
- Parameters:
formatString
- format string to parse.- Returns:
- parsed format string parameters.
-
getTimeFormatPattern
public String getTimeFormatPattern()
- Specified by:
getTimeFormatPattern
in interfaceIFormatService
- Returns:
- default time format pattern.
-
getDateFormatPattern
public String getDateFormatPattern()
- Specified by:
getDateFormatPattern
in interfaceIFormatService
- Returns:
- default date format pattern.
-
getDateTimeFormatPattern
public String getDateTimeFormatPattern()
- Specified by:
getDateTimeFormatPattern
in interfaceIFormatService
- Returns:
- default date time format pattern.
-
-