Package com.ibm.icu.impl.personname
Class FieldModifierImpl
- java.lang.Object
-
- com.ibm.icu.impl.personname.FieldModifierImpl
-
- Direct Known Subclasses:
FieldModifierImpl.AllCapsModifier
,FieldModifierImpl.InitialCapModifier
,FieldModifierImpl.InitialModifier
abstract class FieldModifierImpl extends java.lang.Object
Parent class for classes that implement field-modifier behavior.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
FieldModifierImpl.AllCapsModifier
A field modifier that returns the field value converted to ALL CAPS.private static class
FieldModifierImpl.InitialCapModifier
A field modifier that returns the field value with the first letter of each word capitalized.(package private) static class
FieldModifierImpl.InitialModifier
A field modifier that returns the field value converted into one or more initials.
-
Field Summary
Fields Modifier and Type Field Description private static FieldModifierImpl
MONOGRAM_MODIFIER
A field modifier that simply returns the first grapheme cluster in the field value.private static FieldModifierImpl
NOOP_MODIFIER
A field modifier that just returns the field value unmodified.private static FieldModifierImpl
NULL_MODIFIER
A field modifier that just returns the empty string.
-
Constructor Summary
Constructors Constructor Description FieldModifierImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static FieldModifierImpl
forName(PersonName.FieldModifier modifierID, PersonNameFormatterImpl formatterImpl)
private static java.lang.String
getFirstGrapheme(java.lang.String s)
A utility function that just returns the first grapheme cluster in the string.abstract java.lang.String
modifyField(java.lang.String fieldValue)
-
-
-
Field Detail
-
NOOP_MODIFIER
private static final FieldModifierImpl NOOP_MODIFIER
A field modifier that just returns the field value unmodified. This is used to implement the default behavior of the "informal" and "core" modifiers ("real" informal or core variants have to be supplied or calculated by the PersonName object).
-
NULL_MODIFIER
private static final FieldModifierImpl NULL_MODIFIER
A field modifier that just returns the empty string. This is used to implement the default behavior of the "prefix" modifier ("real" prefix variants have to be supplied to calculated by the PersonName object).
-
MONOGRAM_MODIFIER
private static final FieldModifierImpl MONOGRAM_MODIFIER
A field modifier that simply returns the first grapheme cluster in the field value. This is the default implementation of the "monogram" modifier.
-
-
Method Detail
-
modifyField
public abstract java.lang.String modifyField(java.lang.String fieldValue)
-
forName
public static FieldModifierImpl forName(PersonName.FieldModifier modifierID, PersonNameFormatterImpl formatterImpl)
-
getFirstGrapheme
private static java.lang.String getFirstGrapheme(java.lang.String s)
A utility function that just returns the first grapheme cluster in the string.
-
-