Package com.ibm.icu.text
Class MessagePatternUtil
- java.lang.Object
-
- com.ibm.icu.text.MessagePatternUtil
-
public final class MessagePatternUtil extends Object
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.
- Author:
- Markus Scherer
- Status:
- Stable ICU 49.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMessagePatternUtil.ArgNodeA piece of MessageNode contents representing a message argument and its details.static classMessagePatternUtil.ComplexArgStyleNodeA Node representing details of the argument style of a complex argument.static classMessagePatternUtil.MessageContentsNodeA piece of MessageNode contents.static classMessagePatternUtil.MessageNodeA Node representing a parsed MessageFormat pattern string.static classMessagePatternUtil.NodeCommon base class for all elements in a tree of nodes returned bybuildMessageNode(MessagePattern).static classMessagePatternUtil.TextNodeLiteral text, a piece of MessageNode contents.static classMessagePatternUtil.VariantNodeA Node representing a nested message (nested inside an argument) with its selection criterion.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MessagePatternUtil.MessageNodebuildMessageNode(MessagePattern pattern)Factory method, builds and returns a MessageNode from a MessagePattern.static MessagePatternUtil.MessageNodebuildMessageNode(String patternString)Factory method, builds and returns a MessageNode from a MessageFormat pattern string.
-
-
-
Method Detail
-
buildMessageNode
public static MessagePatternUtil.MessageNode buildMessageNode(String patternString)
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- Status:
- Stable ICU 49.
-
buildMessageNode
public static MessagePatternUtil.MessageNode buildMessageNode(MessagePattern pattern)
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- Status:
- Stable ICU 49.
-
-