public final class JsMessage extends 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(Object o) |
String |
getDesc()
Gets the description associated with this message, intended to help
translators, or null if this message has no description.
|
String |
getId()
Gets the message's id, or name (e.g.
|
String |
getKey()
Gets the message's key, or name (e.g.
|
String |
getMeaning()
Gets the meaning annotated to the message, intended to force different
translations.
|
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).
|
List<CharSequence> |
parts()
Gets a read-only list of the parts of this message.
|
Set<String> |
placeholders()
Gets a read-only set of the registered placeholders in this message.
|
String |
toString() |
public String getSourceName()
public String getKey()
"MSG_HELLO"
).public boolean isAnonymous()
public boolean isExternal()
public String getId()
"92430284230902938293"
).public String getDesc()
public String getMeaning()
public boolean isHidden()
public List<CharSequence> parts()
String
or a JsMessage.PlaceholderReference
.public Set<String> placeholders()
public boolean isEmpty()
Copyright © 2009-2016 Google. All Rights Reserved.