| Package | Description |
|---|---|
| com.google.template.soy.incrementaldomsrc | |
| com.google.template.soy.jssrc.dsl | |
| com.google.template.soy.jssrc.internal |
| Modifier and Type | Method and Description |
|---|---|
protected CodeChunk |
GenIncrementalDomCodeVisitor.generateFunctionBody(TemplateNode node) |
| Modifier and Type | Class and Description |
|---|---|
static class |
CodeChunk.WithValue
Marker class for a chunk of code that represents a value.
|
class |
DoWhile
Represents a
do {....} while(...); loop. |
class |
VariableDeclaration
Represents a variable declaration.
|
| Modifier and Type | Method and Description |
|---|---|
static CodeChunk |
CodeChunk.assign(String varName,
CodeChunk.WithValue rhs)
Creates a code chunk that assigns value to a preexisting variable with the given name.
|
CodeChunk |
SwitchBuilder.build()
Finishes building this switch statement.
|
CodeChunk |
ConditionalBuilder.build()
Finishes building this conditional.
|
static CodeChunk |
CodeChunk.forLoop(String localVar,
CodeChunk.WithValue initial,
CodeChunk.WithValue limit,
CodeChunk.WithValue increment,
CodeChunk body)
Creates a code chunk representing a for loop.
|
static CodeChunk |
CodeChunk.forLoop(String localVar,
CodeChunk.WithValue limit,
CodeChunk body)
Creates a code chunk representing a for loop, with default values for initial & increment.
|
static CodeChunk |
CodeChunk.return_(CodeChunk.WithValue returnValue)
Creates a code chunk that represents a return statement returning the given value.
|
static CodeChunk |
CodeChunk.statements(CodeChunk first,
CodeChunk... rest)
Creates a new code chunk representing the concatenation of the given chunks.
|
static CodeChunk |
CodeChunk.statements(Iterable<CodeChunk> stmts)
Creates a new code chunk representing the concatenation of the given chunks.
|
static CodeChunk |
CodeChunk.throw_(CodeChunk.WithValue throwValue)
Creates a code chunk that represents a throw statement.
|
static CodeChunk |
CodeChunk.treatRawStringAsStatementLegacyOnly(String rawString,
Iterable<GoogRequire> requires)
Creates a code chunk from the given text, treating it as a series of statements rather than an
expression.
|
| Modifier and Type | Method and Description |
|---|---|
abstract com.google.common.collect.ImmutableList<CodeChunk> |
CodeChunk.WithValue.initialStatements()
Returns the initial statements associated with this value.
|
| Modifier and Type | Method and Description |
|---|---|
SwitchBuilder |
SwitchBuilder.case_(CodeChunk.WithValue caseLabel,
CodeChunk body)
Adds a case clause to this switch statement.
|
SwitchBuilder |
SwitchBuilder.case_(com.google.common.collect.ImmutableList<CodeChunk.WithValue> caseLabels,
CodeChunk body)
Adds a case clause (one or more
case labels followed by a body) to this switch
statement. |
SwitchBuilder |
SwitchBuilder.default_(CodeChunk body)
Adds a
default clause to this switch statement. |
ConditionalBuilder |
ConditionalBuilder.else_(CodeChunk trailingElse)
Adds an
else clause encapsulating the given chunk to this conditional. |
ConditionalBuilder |
ConditionalBuilder.elseif_(CodeChunk.WithValue predicate,
CodeChunk consequent)
Adds an
else if clause with the given predicate and consequent to this conditional. |
static CodeChunk |
CodeChunk.forLoop(String localVar,
CodeChunk.WithValue initial,
CodeChunk.WithValue limit,
CodeChunk.WithValue increment,
CodeChunk body)
Creates a code chunk representing a for loop.
|
static CodeChunk |
CodeChunk.forLoop(String localVar,
CodeChunk.WithValue limit,
CodeChunk body)
Creates a code chunk representing a for loop, with default values for initial & increment.
|
static CodeChunk.WithValue |
CodeChunk.function(Iterable<String> parameters,
CodeChunk body)
Creates a code chunk representing an anonymous function literal.
|
static ConditionalBuilder |
CodeChunk.ifStatement(CodeChunk.WithValue predicate,
CodeChunk consequent)
Starts a conditional statement beginning with the given predicate and consequent chunks.
|
abstract DoWhile.Builder |
DoWhile.Builder.setBody(CodeChunk condition) |
static CodeChunk |
CodeChunk.statements(CodeChunk first,
CodeChunk... rest)
Creates a new code chunk representing the concatenation of the given chunks.
|
static CodeChunk |
CodeChunk.statements(CodeChunk first,
CodeChunk... rest)
Creates a new code chunk representing the concatenation of the given chunks.
|
CodeChunk.WithValue |
CodeChunk.WithValue.withInitialStatement(CodeChunk initialStatement)
Convenience method for
withInitialStatements(ImmutableList.of(statement)). |
| Modifier and Type | Method and Description |
|---|---|
static CodeChunk |
CodeChunk.statements(Iterable<CodeChunk> stmts)
Creates a new code chunk representing the concatenation of the given chunks.
|
CodeChunk.WithValue |
CodeChunk.WithValue.withInitialStatements(Iterable<? extends CodeChunk> initialStatements)
Returns a chunk whose output expression is the same as this chunk's, but which includes the
given initial statements.
|
| Modifier and Type | Method and Description |
|---|---|
protected CodeChunk |
GenJsCodeVisitor.generateFunctionBody(TemplateNode node)
Generates the function body.
|
protected CodeChunk |
GenJsCodeVisitor.genParamTypeChecks(TemplateNode node)
Generate code to verify the runtime types of the input params.
|
protected CodeChunk |
GenJsCodeVisitor.visitChildrenReturningCodeChunk(SoyNode.ParentSoyNode<?> node)
Visits the children of the given node, returning a
CodeChunk encapsulating its
JavaScript code. |
CodeChunk |
GenJsCodeVisitor.visitForUseByAssistantsAsCodeChunk(SoyNode node)
This method must only be called by assistant visitors, in particular
GenJsCodeVisitorAssistantForMsgs.
|
| Modifier and Type | Method and Description |
|---|---|
JsCodeBuilder |
JsCodeBuilder.append(CodeChunk codeChunk)
Serializes the given
CodeChunk into the code builder, respecting the code builder's
current indentation level. |