Package com.google.javascript.jscomp
Interface JsMessageDefinition
-
public interface JsMessageDefinitionContainer class that holds information about the JS code a JsMessage was built from.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodegetMessageNode()The RHS node of the message assignment statement.com.google.common.collect.ImmutableMap<java.lang.String,Node>getPlaceholderValueMap()A map from placehlolder name to the Node assigned to it in the values map argument of `goog.getMsg()`.@Nullable NodegetPlaceholderValuesNode()The object literalNodethat maps placeholder names to expressions providing their values.NodegetTemplateTextNode()The Node representing the message text template.booleanshouldEscapeLessThan()The value of the 'html' options key in the options bag argument.booleanshouldUnescapeHtmlEntities()The value of the 'unescapeHtmlEntities' options key in the options bag argument.
-
-
-
Method Detail
-
getMessageNode
Node getMessageNode()
The RHS node of the message assignment statement.e.g. The
goog.getMsg()call in:const MSG_HELLO = goog.getMsg( 'Hello, {$name}.', { 'name', getName() }, { unescapeHtmlEntities: true });
-
getTemplateTextNode
Node getTemplateTextNode()
The Node representing the message text template.This node may be a literal string or a concatenation of literal strings.
For a
goog.getMsg()call this is the second argument.
-
getPlaceholderValuesNode
@Nullable Node getPlaceholderValuesNode()
The object literalNodethat maps placeholder names to expressions providing their values.This value will be
nullif the message definition didn't specify placeholder values.
-
getPlaceholderValueMap
com.google.common.collect.ImmutableMap<java.lang.String,Node> getPlaceholderValueMap()
A map from placehlolder name to the Node assigned to it in the values map argument of `goog.getMsg()`.This will be an empty map if there was no object or it was an empty object literal.
-
shouldEscapeLessThan
boolean shouldEscapeLessThan()
The value of the 'html' options key in the options bag argument.This value will be
falseif there was no options bag argument, or if it didn't contain an 'html' property.
-
shouldUnescapeHtmlEntities
boolean shouldUnescapeHtmlEntities()
The value of the 'unescapeHtmlEntities' options key in the options bag argument.This value will be
falseif there was no options bag argument, or if it didn't contain an 'unescapeHtmlEntities' property.
-
-