|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.codegen.server.StringGenerator
public abstract class StringGenerator
Helper class to produce string expressions consisting of literals and computed values.
Nested Class Summary | |
---|---|
protected static class |
StringGenerator.Type
Type of expression being processed. |
Field Summary | |
---|---|
protected java.lang.StringBuilder |
buf
Output string buffer. |
protected boolean |
inString
True if we are in the middle of a string literal. |
Constructor Summary | |
---|---|
protected |
StringGenerator(java.lang.StringBuilder buf)
Initialize the StringGenerator with an output buffer. |
Method Summary | |
---|---|
protected abstract void |
afterExpression(StringGenerator.Type type)
|
void |
appendExpression(java.lang.String expression,
boolean isSafeHtmlTyped,
boolean isPrimitiveTyped,
boolean needsConversionToString)
Append an expression to this string expression. |
void |
appendStringLiteral(java.lang.String str)
Append part of a string literal. |
void |
appendStringValuedExpression(java.lang.String expression)
Append an expression to this string expression. |
protected abstract void |
beforeExpression(StringGenerator.Type type)
|
void |
completeString()
Complete the string, closing an open quote and handling empty strings. |
static StringGenerator |
create(java.lang.StringBuilder buf,
boolean returnsSafeHtml)
Create a StringGenerator instance. |
protected abstract void |
finishOutput()
|
protected abstract void |
forceStringPrefix()
|
protected abstract void |
forceStringSuffix()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.StringBuilder buf
protected boolean inString
Constructor Detail |
---|
protected StringGenerator(java.lang.StringBuilder buf)
buf
- output bufferMethod Detail |
---|
public static StringGenerator create(java.lang.StringBuilder buf, boolean returnsSafeHtml)
StringGenerator
instance.
buf
- returnsSafeHtml
-
StringGenerator
instancepublic void appendExpression(java.lang.String expression, boolean isSafeHtmlTyped, boolean isPrimitiveTyped, boolean needsConversionToString)
expression
- to addisSafeHtmlTyped
- true if the expression is known to be of type
SafeHtml
; only relevant
if this generator has been initialized to generate a
SafeHtml
-valued
expressionisPrimitiveTyped
- true if the expression is of a primitive type;
only relevant if this generator has been initialized to generate a
SafeHtml
-valued
expressionneedsConversionToString
- true if the expression is not known to be
of type String and needs to be convertedpublic void appendStringLiteral(java.lang.String str)
str
- part of string literalpublic void appendStringValuedExpression(java.lang.String expression)
expression
- to add, which the caller asserts is String-valuedpublic void completeString()
protected abstract void afterExpression(StringGenerator.Type type)
protected abstract void beforeExpression(StringGenerator.Type type)
protected abstract void finishOutput()
protected abstract void forceStringPrefix()
protected abstract void forceStringSuffix()
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |