Package com.ibm.icu.text
Enum PersonName.FieldModifier
- java.lang.Object
-
- java.lang.Enum<PersonName.FieldModifier>
-
- com.ibm.icu.text.PersonName.FieldModifier
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PersonName.FieldModifier>
- Enclosing interface:
- PersonName
public static enum PersonName.FieldModifier extends java.lang.Enum<PersonName.FieldModifier>
Identifiers for the name field modifiers supported by the PersonName and PersonNameFormatter objects.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALL_CAPS
Requests the field value converted to ALL CAPS.CORE
If the field contains a main word with one or more separate prefixes, such as "van den Hul", this requests just the main word ("Hul").GENITIVE
Requests the genitive form of the field's contents, if possible.INFORMAL
Requests an "informal" variant of the field, generally a nickname of some type: if "given" is "James", "given-informal" might be "Jimmy".INITIAL
Requests an initial for the specified field.INITIAL_CAP
Requests the field value with the first grapheme of each word converted to titlecase.MONOGRAM
Requests an initial for the specified field, suitable for use in a monogram (this usually differs from "initial" in that "initial" often adds a period and "monogram" never does).PREFIX
If the field contains a main word with one or more separate prefixes, such as "van den Hul", this requests just the prefixes ("van den").RETAIN
Deprecated.This API is ICU internal only.VOCATIVE
Requests the vocative form of the field's contents, if possible.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name
-
Constructor Summary
Constructors Modifier Constructor Description private
FieldModifier(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PersonName.FieldModifier
forString(java.lang.String name)
Returns the appropriate fieldModifier for its display name.java.lang.String
toString()
Returns the FieldModifier's display name.static PersonName.FieldModifier
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PersonName.FieldModifier[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INFORMAL
public static final PersonName.FieldModifier INFORMAL
Requests an "informal" variant of the field, generally a nickname of some type: if "given" is "James", "given-informal" might be "Jimmy". Only applied to the "given" field. If the PersonName object doesn't apply this modifier, PersonNameFormatter just uses the unmodified version of "given".
-
PREFIX
public static final PersonName.FieldModifier PREFIX
If the field contains a main word with one or more separate prefixes, such as "van den Hul", this requests just the prefixes ("van den"). Only applied to the "surname" field. If the PersonName object doesn't apply this modifier, PersonNameFormatter assumes there are no prefixes.
-
CORE
public static final PersonName.FieldModifier CORE
If the field contains a main word with one or more separate prefixes, such as "van den Hul", this requests just the main word ("Hul"). Only applied to the "surname" field. If the implementing class doesn't apply this modifier, PersonNameFormatter assumes the entire "surname" field is the "core".
-
INITIAL
public static final PersonName.FieldModifier INITIAL
Requests an initial for the specified field. PersonNameFormatter will do this algorithmically, but a PersonName object can apply this modifier itself if it wants different initial-generation logic (or stores the initial separately).
-
MONOGRAM
public static final PersonName.FieldModifier MONOGRAM
Requests an initial for the specified field, suitable for use in a monogram (this usually differs from "initial" in that "initial" often adds a period and "monogram" never does). PersonNameFormatter will do this algorithmically, but a PersonName object can apply this modifier itself if it wants different monogram-generation logic.
-
ALL_CAPS
public static final PersonName.FieldModifier ALL_CAPS
Requests the field value converted to ALL CAPS. PersonName objects generally won't need to handle this modifier themselves.
-
RETAIN
@Deprecated public static final PersonName.FieldModifier RETAIN
Deprecated.This API is ICU internal only.When used in conjunction with "initial", preserves the punctuation between the initials as it existed in the original name field (e.g., "Jean-Claude" initializes into "J-C" instead of "J.C.") Has no effect if "initial" isn't also present in the list of modifiers.
-
INITIAL_CAP
public static final PersonName.FieldModifier INITIAL_CAP
Requests the field value with the first grapheme of each word converted to titlecase. A PersonName object might handle this modifier itself to capitalize words more selectively.
-
GENITIVE
public static final PersonName.FieldModifier GENITIVE
Requests the genitive form of the field's contents, if possible. The default implementation does nothing, but subclasses of PersonName can override getFieldValue() to produce the genitive form (or just add an "xxx-genitive" entry to a SimplePersonName).
-
VOCATIVE
public static final PersonName.FieldModifier VOCATIVE
Requests the vocative form of the field's contents, if possible. The default implementation does nothing, but subclasses of PersonName can override getFieldValue() to produce the vocative form (or just add an "xxx-vocative" entry to a SimplePersonName).
-
-
Method Detail
-
values
public static PersonName.FieldModifier[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PersonName.FieldModifier c : PersonName.FieldModifier.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PersonName.FieldModifier valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
Returns the FieldModifier's display name.- Overrides:
toString
in classjava.lang.Enum<PersonName.FieldModifier>
-
forString
public static PersonName.FieldModifier forString(java.lang.String name)
Returns the appropriate fieldModifier for its display name.
-
-