public class

StringGenerator

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

Class Overview

Helper class to produce string expressions consisting of literals and computed values.

Summary

Public Constructors
StringGenerator(StringBuffer buf, boolean returnsSafeHtml)
Initialize the StringGenerator with an output buffer.
Public Methods
void appendExpression(String expression, boolean isSafeHtmlTyped, boolean isPrimititiveTyped, boolean needsConversionToString)
Append an expression to this string expression.
void appendStringLiteral(String str)
Append part of a string literal.
void appendStringValuedExpression(String expression)
Append an expression to this string expression.
void completeString()
Complete the string, closing an open quote and handling empty strings.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public StringGenerator (StringBuffer buf, boolean returnsSafeHtml)

Initialize the StringGenerator with an output buffer.

Parameters
buf output buffer
returnsSafeHtml if true, an expression of type SafeHtml is being generated, otherwise a String-valued expression is generated

Public Methods

public void appendExpression (String expression, boolean isSafeHtmlTyped, boolean isPrimititiveTyped, boolean needsConversionToString)

Append an expression to this string expression.

Parameters
expression to add
isSafeHtmlTyped true if the expression is known to be of type SafeHtml; only relevant if this generator has been initialized to generate a SafeHtml-valued expression
isPrimititiveTyped true if the expression is of a primitive type; only relevant if this generator has been initialized to generate a SafeHtml-valued expression
needsConversionToString true if the expression is not known to be of type String and needs to be converted

public void appendStringLiteral (String str)

Append part of a string literal.

Parameters
str part of string literal

public void appendStringValuedExpression (String expression)

Append an expression to this string expression.

Parameters
expression to add, which the caller asserts is String-valued

public void completeString ()

Complete the string, closing an open quote and handling empty strings.