Package com.ibm.icu.text
Interface PersonName
- All Known Implementing Classes:
SimplePersonName
public interface PersonName
An object used to provide name data to the PersonNameFormatter for formatting.
Clients can implement this interface to talk directly to some other subsystem
that actually contains the name data (instead of having to copy it into a separate
object just for formatting) or to override the default modifier behavior described
above. A concrete SimplePersonName object that does store the field values directly
is provided.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Identifiers for the name field modifiers supported by the PersonName and PersonNameFormatter objects.static enum
Identifiers for the name fields supported by the PersonName object.static enum
An enum to specify the preferred field order for the name. -
Method Summary
Modifier and TypeMethodDescriptiongetFieldValue
(PersonName.NameField identifier, Set<PersonName.FieldModifier> modifiers) Returns one field of the name, possibly in a modified form.Returns the locale of the name-- that is, the language or country of origin for the person being named.Returns the preferred field order for the name.
-
Method Details
-
getNameLocale
Locale getNameLocale()Returns the locale of the name-- that is, the language or country of origin for the person being named. An implementing class is allowed to return null here to indicate the name's locale is unknown.- Returns:
- The name's locale, or null if it's not known.
-
getPreferredOrder
PersonName.PreferredOrder getPreferredOrder()Returns the preferred field order for the name. PersonName objects should generally return DEFAULT, allowing the PersonNameFormatter to deduce the peoper field order based on the locales of the name and the formatter. But this can be used to force a particular field order, generally in cases where the deduction logic in PersonNameFormatter would guess wrong.- Returns:
- The name's preferred field order.
-
getFieldValue
Returns one field of the name, possibly in a modified form.- Parameters:
identifier
- The identifier of the requested field.modifiers
- An IN/OUT parameter that specifies modifiers to apply to the basic field value. An implementing class can choose to handle or ignore any modifiers; it should modify the passed-in Set so that on exit, it contains only the requested modifiers that it DIDN'T handle. This parameter may not be null, and must either be mutable or empty.- Returns:
- The value of the requested field, optionally modified by some or all of the requested modifiers, or null if the requested field isn't present in the name.
-