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 TypeMethodDescriptionformatToParts(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> supportedLocalesOf(String locale) supportedLocalesOf(String locale, SupportOptions options) supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales) supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options)
-
Method Details
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
listFormat
-
supportedLocalesOf
-
supportedLocalesOf
-
supportedLocalesOf
-
supportedLocalesOf
public static JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options) -
format
-
formatToParts
-
resolvedOptions
-