@Immutable public abstract class VariableDeclaration extends CodeChunk
| Modifier and Type | Class and Description |
|---|---|
static class |
VariableDeclaration.Builder
A builder for a
VariableDeclaration. |
CodeChunk.Generator, CodeChunk.RequiresCollector, CodeChunk.WithValueEMPTY_OBJECT_LITERAL, LITERAL_EMPTY_STRING, LITERAL_FALSE, LITERAL_NULL, LITERAL_TRUE| Constructor and Description |
|---|
VariableDeclaration() |
| Modifier and Type | Method and Description |
|---|---|
static VariableDeclaration.Builder |
builder(String name) |
void |
collectRequires(CodeChunk.RequiresCollector collector)
Adds all the 'goog.require' identifiers needed by this CodeChunk to the given collection.
|
CodeChunk.WithValue |
ref()
Returns a
CodeChunk.WithValue representing a reference to this declared variable. |
arrayLiteral, assertExpr, assertExprAndCollectRequires, assign, dontTrustPrecedenceOf, dottedIdNoRequire, forLoop, forLoop, fromExpr, function, getCode, getStatementsForInsertingIntoForeignCodeAtIndent, id, ifExpression, ifStatement, mapLiteral, new_, not, number, number, operation, regexLiteral, return_, statements, statements, stringLiteral, switch_, throw_, treatRawStringAsStatementLegacyOnlypublic static VariableDeclaration.Builder builder(String name)
public CodeChunk.WithValue ref()
CodeChunk.WithValue representing a reference to this declared variable.public void collectRequires(CodeChunk.RequiresCollector collector)
CodeChunkcollectRequires in class CodeChunk