I18nFormat annotation to indicate the valid
types that may be passed as a format parameter. For example:
@I18nFormat({GENERAL, NUMBER}) String f = "{0}{1, number}";
MessageFormat.format(f, "Example", 0) // valid
The annotation indicates that the format string requires any object as the first parameter
(I18nConversionCategory#GENERAL) and a number as the second parameter (I18nConversionCategory#NUMBER).
| Modifier and Type | Field and Description |
|---|---|
| private static final I18nConversionCategory[] | conversionCategoriesForIntersect
Conversion categories that need to be considered by |
| public static final I18nConversionCategory | DATE
Use if the parameter can be of date, time, or number types. |
| public static final I18nConversionCategory | GENERAL
Use if the parameter can be of any type. |
| private static final I18nConversionCategory[] | |
| public static final I18nConversionCategory | NUMBER
Use if the parameter can be of number or choice types. |
| public final @Nullable [] | |
| public final @Nullable Class | |
| public static final I18nConversionCategory | UNUSED
Use if a parameter is not used by the formatter. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <E> Set | |
| public static I18nConversionCategory | intersect(I18nConversionCategory a, I18nConversionCategory b)
Returns the intersection of the two given I18nConversionCategories. |
| public boolean | Returns: true ifargType can be an argument used by this format specifieran argument type argType)Returns true if |
| public static boolean | Returns: true if a is a subset of bReturn true if a is a subset of b. |
| public static I18nConversionCategory | Returns: the I18nConversionCategory associated with the given stringCreates a conversion cagetogry from a string name. |
| public String | |
| public static I18nConversionCategory | union(I18nConversionCategory a, I18nConversionCategory b)
Returns the union of the two given I18nConversionCategories. |
| public static I18nConversionCategory | |
| public static I18nConversionCategory[] |
| conversionCategoriesForIntersect | back to summary |
|---|---|
| private static final I18nConversionCategory[] conversionCategoriesForIntersect Conversion categories that need to be considered by | |
| DATE | back to summary |
|---|---|
| public static final I18nConversionCategory DATE Use if the parameter can be of date, time, or number types. | |
| GENERAL | back to summary |
|---|---|
| public static final I18nConversionCategory GENERAL Use if the parameter can be of any type. | |
| namedCategories | back to summary |
|---|---|
| private static final I18nConversionCategory[] namedCategories Used by | |
| NUMBER | back to summary |
|---|---|
| public static final I18nConversionCategory NUMBER Use if the parameter can be of number or choice types. An example of choice:
This will print "2 is more than 1".
| |
| strings | back to summary |
|---|---|
public final @Nullable [] strings
| |
| types | back to summary |
|---|---|
public final @Nullable Class<?>[] types
| |
| UNUSED | back to summary |
|---|---|
| public static final I18nConversionCategory UNUSED Use if a parameter is not used by the formatter. For example, in
MessageFormat.format("{1}", a, b);
only the second argument ("b") is used. The first argument ("a") is ignored.
| |
| I18nConversionCategory | back to summary |
|---|---|
| private I18nConversionCategory(@Nullable Class<?>[] types, @Nullable [] strings) | |
| arrayToSet | back to summary |
|---|---|
| private static <E> Set | |
| intersect | back to summary |
|---|---|
| public static I18nConversionCategory intersect(I18nConversionCategory a, I18nConversionCategory b) Returns the intersection of the two given I18nConversionCategories. I18nConversionCategory.intersect(DATE, NUMBER) == NUMBER; | |
| isAssignableFrom | back to summary |
|---|---|
| public boolean isAssignableFrom(Class<?> argType) Returns true if
| |
| isSubsetOf | back to summary |
|---|---|
| public static boolean isSubsetOf(I18nConversionCategory a, I18nConversionCategory b) Return true if a is a subset of b.
| |
| stringToI18nConversionCategory | back to summary |
|---|---|
| public static I18nConversionCategory stringToI18nConversionCategory(String string) Creates a conversion cagetogry from a string name.
I18nConversionCategory.stringToI18nConversionCategory("number") == I18nConversionCategory.NUMBER;
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a pretty printed
| |
| union | back to summary |
|---|---|
| public static I18nConversionCategory union(I18nConversionCategory a, I18nConversionCategory b) Returns the union of the two given I18nConversionCategories. I18nConversionCategory.intersect(DATE, NUMBER) == DATE; | |
| valueOf | back to summary |
|---|---|
| public static I18nConversionCategory valueOf(String name) | |
| values | back to summary |
|---|---|
| public static I18nConversionCategory[] values() | |