|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.javascript.jscomp.JsMessage
public class JsMessage
A representation of a translatable message in JavaScript source code.
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();
| Nested Class Summary | |
|---|---|
static class |
JsMessage.Builder
Contains functionality for creating js messages. |
static interface |
JsMessage.IdGenerator
|
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. |
| Method Summary | |
|---|---|
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 |
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public String getSourceName()
public String getKey()
"MSG_HELLO").
public boolean isAnonymous()
public boolean isExternal()
public String getId()
"92430284230902938293").
public String getDesc()
public boolean isHidden()
public List<CharSequence> parts()
String or a JsMessage.PlaceholderReference.
public Set<String> placeholders()
public String toString()
toString in class Objectpublic boolean isEmpty()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||