Package com.ibm.icu.text
Class PersonNameFormatter
java.lang.Object
com.ibm.icu.text.PersonNameFormatter
Deprecated.
This API is for technology preview only.
A class for formatting names of people. Takes raw name data for a person and renders it into a string according to
the caller's specifications, taking into account how people's names are rendered in the caller's locale.
The Length, Usage, and Formality options can be used to get a wide variety of results. In English, they would
produce results along these lines:
REFERRING | ADDRESSING | MONOGRAM | ||||
---|---|---|---|---|---|---|
FORMAL | INFORMAL | FORMAL | INFORMAL | FORMAL | INFORMAL | |
LONG | James Earl Carter Jr. | Jimmy Carter | Mr. Carter | Jimmy | JEC | JC |
MEDIUM | James E. Carter Jr. | Jimmy Carter | Mr. Carter | Jimmy | C | J |
SHORT | J. E. Carter | Jimmy Carter | Mr. Carter | Jimmy | C | J |
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated.This API is for technology preview only.static enum
Deprecated.This API is for technology preview only.static enum
Deprecated.This API is for technology preview only.static enum
Deprecated.This API is for technology preview only.static enum
Deprecated.This API is for technology preview only. -
Constructor Summary
ConstructorsConstructorDescriptionPersonNameFormatter
(Locale locale, String[] patterns) Deprecated.This API is for unit testing only. -
Method Summary
Modifier and TypeMethodDescriptionstatic PersonNameFormatter.Builder
builder()
Deprecated.This API is for technology preview only.formatToString
(PersonName name) Deprecated.This API is for technology preview only.Deprecated.This API is for technology preview only.
-
Constructor Details
-
PersonNameFormatter
Deprecated.This API is for unit testing only.
-
-
Method Details
-
builder
Deprecated.This API is for technology preview only.Returns a Builder object that can be used to construct a new PersonNameFormatter.- Returns:
- A new Builder.
-
toBuilder
Deprecated.This API is for technology preview only.Returns a Builder object whose fields match those used to construct this formatter, allowing a new formatter to be created based on this one.- Returns:
- A new Builder that can be used to create a new formatter based on this formatter.
-
formatToString
Deprecated.This API is for technology preview only.Formats a name.- Parameters:
name
- A PersonName object that supplies individual field values (optionally, with modifiers applied) to the formatter for formatting.- Returns:
- The name, formatted according to the locale and other parameters passed to the formatter's constructor.
-