public final class JsMessage
extends java.lang.Object
Instances are created using a JsMessage.Builder
,
like this:
JsMessage m = new JsMessage.Builder(key) .appendPart("Hi ") .appendPlaceholderReference("firstName") .appendPart("!") .setDesc("A welcome message") .build();
Modifier and Type | Class and Description |
---|---|
static class |
JsMessage.Builder
Contains functionality for creating JS messages.
|
static interface |
JsMessage.IdGenerator
ID generator
|
static class |
JsMessage.PlaceholderReference
A reference to a placeholder in a translatable message.
|
static class |
JsMessage.Style
Message style that could be used for JS code parsing.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getDesc()
Gets the description associated with this message, intended to help
translators, or null if this message has no description.
|
java.lang.String |
getId()
Gets the message's id, or name (e.g.
|
java.lang.String |
getKey()
Gets the message's key, or name (e.g.
|
java.lang.String |
getMeaning()
Gets the meaning annotated to the message, intended to force different
translations.
|
java.lang.String |
getSourceName()
Gets the message's sourceName.
|
int |
hashCode() |
boolean |
isAnonymous() |
boolean |
isEmpty() |
boolean |
isExternal() |
boolean |
isHidden()
Gets whether this message should be hidden from volunteer translators (to
reduce the chances of a new feature leak).
|
java.util.List<java.lang.CharSequence> |
parts()
Gets a read-only list of the parts of this message.
|
java.util.Set<java.lang.String> |
placeholders()
Gets a read-only set of the registered placeholders in this message.
|
java.lang.String |
toString() |
public java.lang.String getSourceName()
public java.lang.String getKey()
"MSG_HELLO"
).public boolean isAnonymous()
public boolean isExternal()
public java.lang.String getId()
"92430284230902938293"
).public java.lang.String getDesc()
public java.lang.String getMeaning()
public boolean isHidden()
public java.util.List<java.lang.CharSequence> parts()
String
or a JsMessage.PlaceholderReference
.public java.util.Set<java.lang.String> placeholders()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isEmpty()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2009-2018 Google. All Rights Reserved.