Serializable, Comparable<MessagePattern.ApostropheMode>public static enum MessagePattern.ApostropheMode extends Enum<MessagePattern.ApostropheMode>
A pair of adjacent apostrophes always results in a single apostrophe in the output, even when the pair is between two single, text-quoting apostrophes.
The following table shows examples of desired MessageFormat.format() output with the pattern strings that yield that output.
| Desired output | DOUBLE_OPTIONAL | DOUBLE_REQUIRED |
|---|---|---|
| I see {many} | I see '{many}' | (same) |
| I said {'Wow!'} | I said '{''Wow!''}' | (same) |
| I don't know | I don't know OR I don''t know |
I don''t know |
| 枚举常量 | 说明 |
|---|---|
DOUBLE_OPTIONAL |
A literal apostrophe is represented by
either a single or a double apostrophe pattern character.
|
DOUBLE_REQUIRED |
A literal apostrophe must be represented by
a double apostrophe pattern character.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static MessagePattern.ApostropheMode |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static MessagePattern.ApostropheMode[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (MessagePattern.ApostropheMode c : MessagePattern.ApostropheMode.values()) System.out.println(c); |
public static final MessagePattern.ApostropheMode DOUBLE_OPTIONAL
This is the default behavior starting with ICU 4.8.
public static final MessagePattern.ApostropheMode DOUBLE_REQUIRED
This is the behavior of ICU 4.6 and earlier, and of MessageFormat.
public static MessagePattern.ApostropheMode[] values()
for (MessagePattern.ApostropheMode c : MessagePattern.ApostropheMode.values()) System.out.println(c);
public static MessagePattern.ApostropheMode valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值