Package com.google.javascript.jscomp
Interface JsMessageDefinition
-
public interface JsMessageDefinition
Container class that holds aJsMessage
and information about thegoog.getMsg()
call it was built from.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JsMessage
getMessage()
The JsMessage object built from the `goog.getMsg()` call.Node
getMessageNode()
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 Node
getPlaceholderValuesNode()
The object literalNode
that maps placeholder names to expressions providing their values.Node
getTemplateTextNode()
The Node representing the message text template.boolean
shouldEscapeLessThan()
The value of the 'html' options key in the options bag argument.boolean
shouldUnescapeHtmlEntities()
The value of the 'unescapeHtmlEntities' options key in the options bag argument.
-
-
-
Method Detail
-
getMessage
JsMessage getMessage()
The JsMessage object built from the `goog.getMsg()` call.
-
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 first argument.
-
getPlaceholderValuesNode
@Nullable Node getPlaceholderValuesNode()
The object literalNode
that maps placeholder names to expressions providing their values.This value will be
null
if 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
false
if 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
false
if there was no options bag argument, or if it didn't contain an 'unescapeHtmlEntities' property.
-
-