Class MessageFormat


  • public class MessageFormat
    extends Object
    • Constructor Detail

      • MessageFormat

        public MessageFormat()
      • MessageFormat

        public MessageFormat​(String pattern)
      • MessageFormat

        public MessageFormat​(String pattern,
                             Locale locale)
    • Method Detail

      • applyPattern

        public void applyPattern​(String pttrn)
        Sets the pattern used by this message format. Parses the pattern and caches Format objects for simple argument types. Patterns and their interpretation are specified in the class description.
        Parameters:
        pttrn - the pattern for this message format
        Throws:
        IllegalArgumentException - if the pattern is invalid
      • applyPattern

        public void applyPattern​(String pattern,
                                 MessagePattern.ApostropheMode aposMode)
        Sets the ApostropheMode and the pattern used by this message format. Parses the pattern and caches Format objects for simple argument types. Patterns and their interpretation are specified in the class description.

        This method is best used only once on a given object to avoid confusion about the mode, and after constructing the object with an empty pattern string to minimize overhead.

        Parameters:
        pattern - the pattern for this message format
        aposMode - the new ApostropheMode
        Throws:
        IllegalArgumentException - if the pattern is invalid
        See Also:
        MessagePattern.ApostropheMode