com.google.gwt.i18n.rebind
Class MessageFormatParser

java.lang.Object
  extended by com.google.gwt.i18n.rebind.MessageFormatParser

public class MessageFormatParser
extends java.lang.Object

Helper class for parsing MessageFormat-style format strings.


Nested Class Summary
static class MessageFormatParser.ArgumentChunk
          Represents an argument in a template string.
static class MessageFormatParser.StringChunk
          Represents a literal string portion of a template string.
static class MessageFormatParser.TemplateChunk
          Represents a parsed chunk of a template.
 
Constructor Summary
MessageFormatParser()
           
 
Method Summary
static java.lang.String assemble(java.lang.Iterable<MessageFormatParser.TemplateChunk> parts)
          Generate a MessageFormat-style string representing the supplied components, properly quoting any special characters in string literal portions.
static java.util.List<MessageFormatParser.TemplateChunk> parse(java.lang.String template)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFormatParser

public MessageFormatParser()
Method Detail

assemble

public static java.lang.String assemble(java.lang.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

parse

public static java.util.List<MessageFormatParser.TemplateChunk> parse(java.lang.String template)
                                                               throws java.text.ParseException
Throws:
java.text.ParseException