public final class SoyJsPluginUtils extends Object
The main code-generating classes of the JS backend understand code chunks
and have no need for these utilities. By contrast, plugins understand only JsExprs. These
utilities are provided so that plugins do not needs to convert between code chunks and JsExprs
manually.
| Modifier and Type | Method and Description |
|---|---|
static CodeChunk.WithValue |
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 JsExpr |
genJsExprUsingSoySyntax(Operator op,
List<JsExpr> operandJsExprs)
Generates a JS expression for the given operator and operands.
|
public static JsExpr genJsExprUsingSoySyntax(Operator op, List<JsExpr> operandJsExprs)
public static CodeChunk.WithValue applyDirective(CodeChunk.Generator generator, CodeChunk.WithValue expr, SoyJsSrcPrintDirective directive, List<CodeChunk.WithValue> args)
expr and returns the result.generator - The CodeChunk generator to use.expr - The expression to apply the print directive to.directive - The print directive to apply.args - Print directive args, if any.