Class ListFormat
java.lang.Object
org.jboss.elemento.intl.ListFormat
@JsType(isNative=true,
namespace="<global>",
name="Intl.ListFormat")
public class ListFormat
extends Object
Mapping for
Intl.ListFormat.
var vehicles = JsArray.of("Motorcycle", "Bus", "Car");
var formatter = listFormat("en", listFormatOptions()
.style(long_)
.type(conjunction));
console.log(formatter.format(vehicles));
// Expected output: "Motorcycle, Bus, and Car"
var formatter2 = listFormat("de", listFormatOptions()
.style(short_)
.type(disjunction));
console.log(formatter2.format(vehicles));
// Expected output: "Motorcycle, Bus oder Car"
var formatter3 = listFormat("en", listFormatOptions()
.style(narrow)
.type(unit));
console.log(formatter3.format(vehicles));
// Expected output: "Motorcycle Bus Car"
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionelemental2.core.JsArray<jsinterop.base.JsPropertyMap<String>> formatToParts(elemental2.core.JsArray<String> list) static ListFormatstatic ListFormatlistFormat(String locale) static ListFormatlistFormat(String[] locales) static ListFormatlistFormat(String[] locales, ListFormatOptions options) static ListFormatlistFormat(String locale, ListFormatOptions options) static ListFormatlistFormat(ListFormatOptions options) static ListFormatlistFormat(Locale locale) static ListFormatlistFormat(Locale[] locales) static ListFormatlistFormat(Locale[] locales, ListFormatOptions options) static ListFormatlistFormat(Locale locale, ListFormatOptions options) jsinterop.base.JsPropertyMap<String> static elemental2.core.JsArray<String> supportedLocalesOf(String locale) static elemental2.core.JsArray<String> supportedLocalesOf(String locale, SupportOptions options) static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales) static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options)
-
Method Details
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
supportedLocalesOf
-
supportedLocalesOf
public static elemental2.core.JsArray<String> supportedLocalesOf(String locale, SupportOptions options) -
supportedLocalesOf
-
supportedLocalesOf
public static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options) -
format
-
formatToParts
-
resolvedOptions
-