public class

MessageFormatParser

extends Object
java.lang.Object
   ↳ com.google.gwt.i18n.rebind.MessageFormatParser

Class Overview

Helper class for parsing MessageFormat-style format strings.

Summary

Nested Classes
class MessageFormatParser.ArgumentChunk Represents an argument in a template string. 
class MessageFormatParser.DefaultTemplateChunkVisitor Default implementation of TemplateChunkVisitor -- other implementations should extend this if possible to avoid breakage when new TemplateChunk subtypes are added. 
class MessageFormatParser.StaticArgChunk Represents a static argument, which is used to remove markup from translator view without having to supply it at each callsite. 
class MessageFormatParser.StringChunk Represents a literal string portion of a template string. 
class MessageFormatParser.TemplateChunk Represents a parsed chunk of a template. 
interface MessageFormatParser.TemplateChunkVisitor Visitor for template chunks. 
Public Constructors
MessageFormatParser()
Public Methods
static String assemble(Iterable<MessageFormatParser.TemplateChunk> parts)
Generate a MessageFormat-style string representing the supplied components, properly quoting any special characters in string literal portions.
static List<MessageFormatParser.TemplateChunk> parse(String template)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MessageFormatParser ()

Public Methods

public static String assemble (Iterable<MessageFormatParser.TemplateChunk> parts)

Generate a MessageFormat-style string representing the supplied components, properly quoting any special characters in string literal portions. Note that additional quoting may be required depending on how it will be used, such as backslash-escaping double quotes if it will be used in a generated string constant.

Parameters
parts list of TemplateChunks to assemble
Returns
  • assembled/quoted string

public static List<MessageFormatParser.TemplateChunk> parse (String template)