Package com.ibm.icu.text
Class MessagePatternUtil
java.lang.Object
com.ibm.icu.text.MessagePatternUtil
Utilities for working with a MessagePattern.
Intended for use in tools when convenience is more important than
minimizing runtime and object creations.
This class only has static methods. Each of the nested classes is immutable and thread-safe.
This class and its nested classes are not intended for public subclassing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A piece of MessageNode contents representing a message argument and its details.static class
A Node representing details of the argument style of a complex argument.static class
A piece of MessageNode contents.static class
A Node representing a parsed MessageFormat pattern string.static class
Common base class for all elements in a tree of nodes returned bybuildMessageNode(MessagePattern)
.static class
Literal text, a piece of MessageNode contents.static class
A Node representing a nested message (nested inside an argument) with its selection criterion. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static MessagePatternUtil.ArgNode
buildArgNode
(MessagePattern pattern, int start, int limit) private static MessagePatternUtil.ComplexArgStyleNode
buildChoiceStyleNode
(MessagePattern pattern, int start, int limit) buildMessageNode
(MessagePattern pattern) Factory method, builds and returns a MessageNode from a MessagePattern.private static MessagePatternUtil.MessageNode
buildMessageNode
(MessagePattern pattern, int start, int limit) buildMessageNode
(String patternString) Factory method, builds and returns a MessageNode from a MessageFormat pattern string.private static MessagePatternUtil.ComplexArgStyleNode
buildPluralStyleNode
(MessagePattern pattern, int start, int limit, MessagePattern.ArgType argType) private static MessagePatternUtil.ComplexArgStyleNode
buildSelectStyleNode
(MessagePattern pattern, int start, int limit)
-
Constructor Details
-
MessagePatternUtil
private MessagePatternUtil()
-
-
Method Details
-
buildMessageNode
Factory method, builds and returns a MessageNode from a MessageFormat pattern string.- Parameters:
patternString
- a MessageFormat pattern string- Returns:
- a MessageNode or a ComplexArgStyleNode
- Throws:
IllegalArgumentException
- if the MessagePattern is empty or does not represent a MessageFormat pattern
-
buildMessageNode
Factory method, builds and returns a MessageNode from a MessagePattern.- Parameters:
pattern
- a parsed MessageFormat pattern string- Returns:
- a MessageNode or a ComplexArgStyleNode
- Throws:
IllegalArgumentException
- if the MessagePattern is empty or does not represent a MessageFormat pattern
-
buildMessageNode
private static MessagePatternUtil.MessageNode buildMessageNode(MessagePattern pattern, int start, int limit) -
buildArgNode
private static MessagePatternUtil.ArgNode buildArgNode(MessagePattern pattern, int start, int limit) -
buildChoiceStyleNode
private static MessagePatternUtil.ComplexArgStyleNode buildChoiceStyleNode(MessagePattern pattern, int start, int limit) -
buildPluralStyleNode
private static MessagePatternUtil.ComplexArgStyleNode buildPluralStyleNode(MessagePattern pattern, int start, int limit, MessagePattern.ArgType argType) -
buildSelectStyleNode
private static MessagePatternUtil.ComplexArgStyleNode buildSelectStyleNode(MessagePattern pattern, int start, int limit)
-