Class 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
    • 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
      • 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