| 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 |
|---|---|
List<CodeChunk.WithValue> |
GenIncrementalDomExprsVisitor.exec(SoyNode node) |
| Modifier and Type | Field and Description |
|---|---|
static CodeChunk.WithValue |
CodeChunk.EMPTY_OBJECT_LITERAL |
static CodeChunk.WithValue |
CodeChunk.LITERAL_EMPTY_STRING |
static CodeChunk.WithValue |
CodeChunk.LITERAL_FALSE |
static CodeChunk.WithValue |
CodeChunk.LITERAL_NULL |
static CodeChunk.WithValue |
CodeChunk.LITERAL_TRUE |
| Modifier and Type | Method and Description |
|---|---|
CodeChunk.WithValue |
CodeChunk.WithValue.and(CodeChunk.WithValue rhs,
CodeChunk.Generator codeGenerator)
Returns a code chunk representing the logical and (
&&) of this chunk with the given
chunk. |
static CodeChunk.WithValue |
SoyJsPluginUtils.applyDirective(CodeChunk.Generator generator,
CodeChunk.WithValue expr,
SoyJsSrcPrintDirective directive,
List<CodeChunk.WithValue> args)
Applies the given print directive to
expr and returns the result. |
static CodeChunk.WithValue |
CodeChunk.arrayLiteral(Iterable<? extends CodeChunk.WithValue> elements)
Creates a code chunk representing a javascript array literal.
|
CodeChunk.WithValue |
CodeChunk.WithValue.assign(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.bracketAccess(CodeChunk.WithValue arg) |
CodeChunk.WithValue |
ConditionalExpressionBuilder.build(CodeChunk.Generator codeGenerator)
Finishes building this conditional.
|
CodeChunk.WithValue |
CodeChunk.WithValue.call(CodeChunk.WithValue... args) |
CodeChunk.WithValue |
CodeChunk.WithValue.call(Iterable<? extends CodeChunk.WithValue> args) |
static CodeChunk.WithValue |
CodeChunkUtils.concatChunks(List<? extends CodeChunk.WithValue> chunks)
Builds a
CodeChunk.WithValue that represents the concatenation of the given code
chunks. |
static CodeChunk.WithValue |
CodeChunkUtils.concatChunksForceString(List<? extends CodeChunk.WithValue> chunks)
Builds a
CodeChunk.WithValue that represents the concatenation of the given code
chunks. |
CodeChunk.WithValue |
CodeChunk.Generator.conditionalExpression(CodeChunk.WithValue predicate,
CodeChunk.WithValue consequent,
CodeChunk.WithValue alternate)
Returns a code chunk representing an if-then-else condition.
|
CodeChunk.WithValue |
CodeChunk.WithValue.divideBy(CodeChunk.WithValue rhs) |
static CodeChunk.WithValue |
CodeChunk.dontTrustPrecedenceOf(JsExpr couldHaveWrongPrecedence,
Iterable<GoogRequire> requires)
Wraps a
JsExpr that could have incorrect precedence in parens. |
CodeChunk.WithValue |
GoogRequire.dotAccess(String ident)
Access a member of this required symbol.
|
CodeChunk.WithValue |
CodeChunk.WithValue.dotAccess(String identifier)
Takes in a String identifier for convenience, since that's what most use cases need.
|
static CodeChunk.WithValue |
CodeChunk.dottedIdNoRequire(String dotSeparatedIdentifiers)
Creates a code chunk representing a JavaScript "dotted identifier" which needs no
goog.require statements to be added. |
CodeChunk.WithValue |
CodeChunk.WithValue.doubleEquals(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.doubleEqualsNull() |
CodeChunk.WithValue |
CodeChunk.WithValue.doubleNotEquals(CodeChunk.WithValue rhs) |
static CodeChunk.WithValue |
CodeChunk.fromExpr(JsExpr expr,
Iterable<GoogRequire> requires)
Creates a new code chunk from the given expression.
|
static CodeChunk.WithValue |
CodeChunk.function(Iterable<String> parameters,
CodeChunk body)
Creates a code chunk representing an anonymous function literal.
|
static CodeChunk.WithValue |
CodeChunk.id(String id)
Creates a code chunk representing a JavaScript identifier.
|
CodeChunk.WithValue |
CodeChunk.WithValue.instanceof_(CodeChunk.WithValue identifier) |
static CodeChunk.WithValue |
CodeChunk.mapLiteral(Iterable<? extends CodeChunk.WithValue> keys,
Iterable<? extends CodeChunk.WithValue> values)
Creates a code chunk representing a javascript map literal.
|
CodeChunk.WithValue |
CodeChunk.WithValue.minus(CodeChunk.WithValue rhs) |
static CodeChunk.WithValue |
CodeChunk.new_(CodeChunk.WithValue ctor)
Creates a code chunk representing the
new operator applied to the given constructor. |
static CodeChunk.WithValue |
CodeChunk.not(CodeChunk.WithValue arg)
Creates a code chunk representing the logical negation
! of the given chunk. |
static CodeChunk.WithValue |
CodeChunk.number(double value)
Creates a code chunk representing a JavaScript number literal.
|
static CodeChunk.WithValue |
CodeChunk.number(long value)
Creates a code chunk representing a JavaScript number literal.
|
CodeChunk.WithValue |
CodeChunk.WithValue.op(Operator op,
CodeChunk.WithValue rhs) |
static CodeChunk.WithValue |
CodeChunk.operation(Operator op,
List<CodeChunk.WithValue> operands)
Creates a code chunk representing the given Soy operator applied to the given operands.
|
CodeChunk.WithValue |
CodeChunk.WithValue.or(CodeChunk.WithValue rhs,
CodeChunk.Generator codeGenerator)
Returns a code chunk representing the logical or (
||) of this chunk with the given
chunk. |
CodeChunk.WithValue |
CodeChunk.WithValue.plus(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.plusEquals(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
VariableDeclaration.ref()
Returns a
CodeChunk.WithValue representing a reference to this declared variable. |
CodeChunk.WithValue |
GoogRequire.reference()
Returns a code chunk that can act as a reference to the required symbol.
|
static CodeChunk.WithValue |
CodeChunk.regexLiteral(String contents)
Creates a code chunk representing a JavaScript regular expression literal.
|
static CodeChunk.WithValue |
CodeChunk.stringLiteral(String contents)
Creates a code chunk representing a JavaScript string literal.
|
CodeChunk.WithValue |
CodeChunk.WithValue.times(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.tripleEquals(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.withInitialStatement(CodeChunk initialStatement)
Convenience method for
withInitialStatements(ImmutableList.of(statement)). |
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 |
|---|---|
CodeChunk.WithValue |
CodeChunk.WithValue.and(CodeChunk.WithValue rhs,
CodeChunk.Generator codeGenerator)
Returns a code chunk representing the logical and (
&&) of this chunk with the given
chunk. |
static CodeChunk.WithValue |
SoyJsPluginUtils.applyDirective(CodeChunk.Generator generator,
CodeChunk.WithValue expr,
SoyJsSrcPrintDirective directive,
List<CodeChunk.WithValue> args)
Applies the given print directive to
expr and returns the result. |
CodeChunk.WithValue |
CodeChunk.WithValue.assign(CodeChunk.WithValue rhs) |
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.WithValue |
CodeChunk.WithValue.bracketAccess(CodeChunk.WithValue arg) |
CodeChunk.WithValue |
CodeChunk.WithValue.call(CodeChunk.WithValue... args) |
SwitchBuilder |
SwitchBuilder.case_(CodeChunk.WithValue caseLabel,
CodeChunk body)
Adds a case clause to this switch statement.
|
CodeChunk.WithValue |
CodeChunk.Generator.conditionalExpression(CodeChunk.WithValue predicate,
CodeChunk.WithValue consequent,
CodeChunk.WithValue alternate)
Returns a code chunk representing an if-then-else condition.
|
CodeChunk.WithValue |
CodeChunk.WithValue.divideBy(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.doubleEquals(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.doubleNotEquals(CodeChunk.WithValue rhs) |
ConditionalExpressionBuilder |
ConditionalExpressionBuilder.else_(CodeChunk.WithValue trailingElse) |
ConditionalExpressionBuilder |
ConditionalExpressionBuilder.elseif_(CodeChunk.WithValue predicate,
CodeChunk.WithValue consequent) |
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 ConditionalExpressionBuilder |
CodeChunk.ifExpression(CodeChunk.WithValue predicate,
CodeChunk.WithValue consequent)
Starts a conditional expression beginning with the given predicate and consequent chunks.
|
static ConditionalBuilder |
CodeChunk.ifStatement(CodeChunk.WithValue predicate,
CodeChunk consequent)
Starts a conditional statement beginning with the given predicate and consequent chunks.
|
CodeChunk.WithValue |
CodeChunk.WithValue.instanceof_(CodeChunk.WithValue identifier) |
CodeChunk.WithValue |
CodeChunk.WithValue.minus(CodeChunk.WithValue rhs) |
static CodeChunk.WithValue |
CodeChunk.new_(CodeChunk.WithValue ctor)
Creates a code chunk representing the
new operator applied to the given constructor. |
static CodeChunk.WithValue |
CodeChunk.not(CodeChunk.WithValue arg)
Creates a code chunk representing the logical negation
! of the given chunk. |
CodeChunk.WithValue |
CodeChunk.WithValue.op(Operator op,
CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.or(CodeChunk.WithValue rhs,
CodeChunk.Generator codeGenerator)
Returns a code chunk representing the logical or (
||) of this chunk with the given
chunk. |
CodeChunk.WithValue |
CodeChunk.WithValue.plus(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.plusEquals(CodeChunk.WithValue rhs) |
static CodeChunk |
CodeChunk.return_(CodeChunk.WithValue returnValue)
Creates a code chunk that represents a return statement returning the given value.
|
abstract DoWhile.Builder |
DoWhile.Builder.setCondition(CodeChunk.WithValue condition) |
abstract VariableDeclaration.Builder |
VariableDeclaration.Builder.setRhs(CodeChunk.WithValue value) |
static SwitchBuilder |
CodeChunk.switch_(CodeChunk.WithValue switchOn)
Starts a
switch statement dispatching on the given chunk. |
static CodeChunk |
CodeChunk.throw_(CodeChunk.WithValue throwValue)
Creates a code chunk that represents a throw statement.
|
CodeChunk.WithValue |
CodeChunk.WithValue.times(CodeChunk.WithValue rhs) |
CodeChunk.WithValue |
CodeChunk.WithValue.tripleEquals(CodeChunk.WithValue rhs) |
| Modifier and Type | Method and Description |
|---|---|
static CodeChunk.WithValue |
SoyJsPluginUtils.applyDirective(CodeChunk.Generator generator,
CodeChunk.WithValue expr,
SoyJsSrcPrintDirective directive,
List<CodeChunk.WithValue> args)
Applies the given print directive to
expr and returns the result. |
static CodeChunk.WithValue |
CodeChunk.arrayLiteral(Iterable<? extends CodeChunk.WithValue> elements)
Creates a code chunk representing a javascript array literal.
|
CodeChunk.WithValue |
CodeChunk.WithValue.call(Iterable<? extends CodeChunk.WithValue> args) |
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. |
static CodeChunk.WithValue |
CodeChunkUtils.concatChunks(List<? extends CodeChunk.WithValue> chunks)
Builds a
CodeChunk.WithValue that represents the concatenation of the given code
chunks. |
static CodeChunk.WithValue |
CodeChunkUtils.concatChunksForceString(List<? extends CodeChunk.WithValue> chunks)
Builds a
CodeChunk.WithValue that represents the concatenation of the given code
chunks. |
static CodeChunk.WithValue |
CodeChunk.mapLiteral(Iterable<? extends CodeChunk.WithValue> keys,
Iterable<? extends CodeChunk.WithValue> values)
Creates a code chunk representing a javascript map literal.
|
static CodeChunk.WithValue |
CodeChunk.mapLiteral(Iterable<? extends CodeChunk.WithValue> keys,
Iterable<? extends CodeChunk.WithValue> values)
Creates a code chunk representing a javascript map literal.
|
static CodeChunk.WithValue |
CodeChunk.operation(Operator op,
List<CodeChunk.WithValue> operands)
Creates a code chunk representing the given Soy operator applied to the given operands.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<CodeChunk.WithValue> |
GenJsExprsVisitor.chunks
List to collect the results.
|
| Modifier and Type | Method and Description |
|---|---|
static CodeChunk.WithValue |
JsRuntime.extensionField(com.google.protobuf.Descriptors.FieldDescriptor desc)
Returns the field containing the extension object for the given field descriptor.
|
CodeChunk.WithValue |
GenCallCodeUtils.gen(CallNode callNode,
TemplateAliases templateAliases,
TranslationContext translationContext,
ErrorReporter errorReporter)
Generates the JS expression for a given call.
|
CodeChunk.WithValue |
GenJsCodeVisitorAssistantForMsgs.generateMsgGroupVariable(MsgFallbackGroupNode node)
Returns a code chunk representing a translated variable.
|
protected CodeChunk.WithValue |
GenJsCodeVisitorAssistantForMsgs.genGoogMsgPlaceholder(MsgPlaceholderNode msgPhNode)
Returns a code chunk for the given placeholder node.
|
CodeChunk.WithValue |
SoyToJsVariableMappings.get(String name)
Returns the JavaScript translation for the Soy variable with the given name,
|
CodeChunk.WithValue |
SoyToJsVariableMappings.isPrimaryMsgInUse(MsgFallbackGroupNode msg) |
CodeChunk.WithValue |
SoyToJsVariableMappings.maybeGet(String name)
Returns the JavaScript translation for the Soy variable with the given name,
or null if no mapping exists for that variable.
|
protected CodeChunk.WithValue |
GenCallCodeUtils.maybeWrapContent(CodeChunk.Generator generator,
CallParamContentNode node,
CodeChunk.WithValue content)
If the param node had a content kind specified, it was autoescaped in the
corresponding context.
|
static CodeChunk.WithValue |
JsRuntime.protoConstructor(SoyProtoType type)
Returns the constructor for the proto.
|
static CodeChunk.WithValue |
JsRuntime.protoToSanitizedContentConverterFunction(com.google.protobuf.Descriptors.Descriptor messageType)
Returns a function that can 'unpack' safe proto types into sanitized content types..
|
protected CodeChunk.WithValue |
GenJsCodeVisitor.sanitize(CodeChunk.WithValue templateBody,
SanitizedContentKind contentKind) |
static CodeChunk.WithValue |
JsRuntime.sanitizedContentOrdainerFunction(SanitizedContentKind kind)
Returns an 'ordainer' function that can be used wrap a
string in a SanitizedContent object with no escaping. |
static CodeChunk.WithValue |
JsRuntime.sanitizedContentOrdainerFunctionForInternalBlocks(SanitizedContentKind kind)
Returns an 'ordainer' function that can be used wrap a
string in a SanitizedContent object with no escaping. |
static CodeChunk.WithValue |
JsRuntime.sanitizedContentToProtoConverterFunction(com.google.protobuf.Descriptors.Descriptor messageType)
Returns a function that can 'unpack' safe proto types into sanitized content types..
|
static CodeChunk.WithValue |
JsRuntime.sanitizedContentType(SanitizedContentKind kind)
Returns the js type for the sanitized content object corresponding to the given ContentKind.
|
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitAndOpNode(OperatorNodes.AndOpNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitBooleanNode(BooleanNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitConditionalOpNode(OperatorNodes.ConditionalOpNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitDataAccessNode(DataAccessNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitExprRootNode(ExprRootNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitFloatNode(FloatNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitFunctionNode(FunctionNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitGlobalNode(GlobalNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitIntegerNode(IntegerNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitLegacyObjectMapLiteralNode(LegacyObjectMapLiteralNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitListLiteralNode(ListLiteralNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitMapLiteralNode(MapLiteralNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitNullCoalescingOpNode(OperatorNodes.NullCoalescingOpNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitNullNode(NullNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitOperatorNode(ExprNode.OperatorNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitOrOpNode(OperatorNodes.OrOpNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitProtoInitNode(ProtoInitNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitStringNode(StringNode node) |
protected CodeChunk.WithValue |
TranslateExprNodeVisitor.visitVarRefNode(VarRefNode node) |
| Modifier and Type | Method and Description |
|---|---|
List<CodeChunk.WithValue> |
GenJsExprsVisitor.exec(SoyNode node) |
List<CodeChunk.WithValue> |
GenJsExprsVisitor.execOnChildren(SoyNode.ParentSoyNode<?> node)
Executes this visitor on the children of the given node, without visiting the given node
itself.
|
| Modifier and Type | Method and Description |
|---|---|
JsCodeBuilder |
JsCodeBuilder.addChunkToOutputVar(CodeChunk.WithValue chunk)
Appends the given code chunk to the current output variable.
|
protected CodeChunk.WithValue |
GenCallCodeUtils.maybeWrapContent(CodeChunk.Generator generator,
CallParamContentNode node,
CodeChunk.WithValue content)
If the param node had a content kind specified, it was autoescaped in the
corresponding context.
|
SoyToJsVariableMappings |
SoyToJsVariableMappings.put(String var,
CodeChunk.WithValue translation)
Maps the Soy variable named
name to the given translation. |
protected CodeChunk.WithValue |
GenJsCodeVisitor.sanitize(CodeChunk.WithValue templateBody,
SanitizedContentKind contentKind) |
SoyToJsVariableMappings |
SoyToJsVariableMappings.setIsPrimaryMsgInUse(MsgFallbackGroupNode msg,
CodeChunk.WithValue var) |
| Modifier and Type | Method and Description |
|---|---|
JsCodeBuilder |
JsCodeBuilder.addChunksToOutputVar(List<? extends CodeChunk.WithValue> codeChunks)
Appends one or more lines representing the concatenation of the values of the given code chunks
saved to the current output variable.
|