public final class SoyToJsVariableMappings extends Object
| Modifier and Type | Method and Description |
|---|---|
static SoyToJsVariableMappings |
forNewTemplate()
Returns a new
SoyToJsVariableMappings suitable for translating an entire template. |
CodeChunk.WithValue |
get(String name)
Returns the JavaScript translation for the Soy variable with the given name,
|
CodeChunk.WithValue |
isPrimaryMsgInUse(MsgFallbackGroupNode msg) |
CodeChunk.WithValue |
maybeGet(String name)
Returns the JavaScript translation for the Soy variable with the given name,
or null if no mapping exists for that variable.
|
SoyToJsVariableMappings |
put(String var,
CodeChunk.WithValue translation)
Maps the Soy variable named
name to the given translation. |
SoyToJsVariableMappings |
setIsPrimaryMsgInUse(MsgFallbackGroupNode msg,
CodeChunk.WithValue var) |
public static SoyToJsVariableMappings forNewTemplate()
SoyToJsVariableMappings suitable for translating an entire template.public SoyToJsVariableMappings put(String var, CodeChunk.WithValue translation)
name to the given translation.
Any previous mapping for the variable is lost.
TODO(brndn): this API requires callers to mangle the names they pass in to ensure uniqueness.
Do the mangling internally.public SoyToJsVariableMappings setIsPrimaryMsgInUse(MsgFallbackGroupNode msg, CodeChunk.WithValue var)
public CodeChunk.WithValue get(String name)
public CodeChunk.WithValue isPrimaryMsgInUse(MsgFallbackGroupNode msg)
@Nullable public CodeChunk.WithValue maybeGet(String name)
forNewTemplate() with the params.