public static abstract class

MessageFormatParser.TemplateChunk

extends Object
java.lang.Object
   ↳ com.google.gwt.i18n.rebind.MessageFormatParser.TemplateChunk
Known Direct Subclasses

Class Overview

Represents a parsed chunk of a template.

Summary

Public Constructors
MessageFormatParser.TemplateChunk()
Public Methods
abstract void accept(MessageFormatParser.TemplateChunkVisitor visitor)
String getAsMessageFormatString()
Returns the string as this chunk would be represented in a MessageFormat template, with any required quoting such that reparsing this value would produce an equivalent (note, not identical) parse.
String getString()
Returns the string as this chunk would be represented in a MessageFormat template, with any quoting removed.
boolean isLiteral()
Protected Methods
abstract String getStringValue(boolean quote)
Returns the optionally quoted string value of this chunk as represented in a MessgeFormat string.
static String quoteMessageFormatChars(String str, boolean quote)
Possibly quote a string in the MessageFormat-style.
static String quoteMessageFormatChars(String str)
Quote a string in the MessageFormat-style.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MessageFormatParser.TemplateChunk ()

Public Methods

public abstract void accept (MessageFormatParser.TemplateChunkVisitor visitor)

Throws
UnableToCompleteException

public String getAsMessageFormatString ()

Returns the string as this chunk would be represented in a MessageFormat template, with any required quoting such that reparsing this value would produce an equivalent (note, not identical) parse. Note that the default implementation may not be sufficient for all subclasses.

public String getString ()

Returns the string as this chunk would be represented in a MessageFormat template, with any quoting removed. Note that this is distinct from toString in that the latter is intend for human consumption.

public boolean isLiteral ()

Protected Methods

protected abstract String getStringValue (boolean quote)

Returns the optionally quoted string value of this chunk as represented in a MessgeFormat string.

Parameters
quote true if the result should be quoted
Returns
  • optionally quoted MessageFormat string

protected static String quoteMessageFormatChars (String str, boolean quote)

Possibly quote a string in the MessageFormat-style.

Returns
  • quoted string

protected static String quoteMessageFormatChars (String str)

Quote a string in the MessageFormat-style.

Parameters
str string to quote, must not be null
Returns
  • quoted string