public final class SoyMsg extends Object
| Constructor and Description |
|---|
SoyMsg(long id,
long altId,
String localeString,
String meaning,
String desc,
boolean isHidden,
String contentType,
String sourcePath,
boolean isPlrselMsg,
List<SoyMsgPart> parts) |
SoyMsg(long id,
String localeString,
boolean isPlrselMsg,
List<SoyMsgPart> parts)
Constructor with just enough information for rendering only.
|
SoyMsg(long id,
String localeString,
String meaning,
String desc,
boolean isHidden,
String contentType,
String sourcePath,
List<SoyMsgPart> parts) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSourcePath(String sourcePath) |
boolean |
equals(Object otherObject) |
long |
getAltId()
Returns the alternate unique id for this message, or -1L if not applicable.
|
String |
getContentType()
Returns the content type of the document that this message will appear in.
|
String |
getDesc()
Returns the description for translators.
|
long |
getId()
Returns the unique id for this message (same across all translations).
|
String |
getLocaleString()
Returns the language/locale string.
|
String |
getMeaning()
Returns the meaning string if set, otherwise null (usually null).
|
com.google.common.collect.ImmutableList<SoyMsgPart> |
getParts()
Returns the parts that make up the message content.
|
com.google.common.collect.ImmutableSet<String> |
getSourcePaths()
Returns the location(s) of the source file(s) that this message comes from.
|
int |
hashCode() |
boolean |
isHidden()
Returns whether this message should be hiddens.
|
boolean |
isPlrselMsg()
Returns whether this is a plural/select message.
|
String |
toString() |
public SoyMsg(long id,
long altId,
@Nullable
String localeString,
@Nullable
String meaning,
@Nullable
String desc,
boolean isHidden,
@Nullable
String contentType,
@Nullable
String sourcePath,
boolean isPlrselMsg,
List<SoyMsgPart> parts)
id - A unique id for this message (same across all translations).altId - An alternate unique id for this message, or -1L if not applicable.localeString - The language/locale string, or null if unknown. Should only be null for
messages newly extracted from source files. Should always be set for messages parsed from
message files/resources.meaning - The meaning string, or null if not necessary (usually null). This is a string
to create unique messages for two otherwise identical messages. This is usually done for
messages used in different contexts. (For example, the same word can be used as a noun in
one location and as a verb in another location, and the message texts would be the same
but the messages would have meanings of "noun" and "verb".). May not be applicable to all
message plugins.desc - The description for translators.isHidden - Whether this message should be hidden. May not be applicable to all message
plugins.contentType - Content type of the document that this message will appear in
(e.g. "text/html"). May not be applicable to all message plugins.sourcePath - Location of a source file that this message comes from. More sources can
be added using addSourcePath(). May not be applicable to all message plugins.isPlrselMsg - Whether this is a plural/select message.parts - The parts that make up the message content.public SoyMsg(long id,
@Nullable
String localeString,
@Nullable
String meaning,
@Nullable
String desc,
boolean isHidden,
@Nullable
String contentType,
@Nullable
String sourcePath,
List<SoyMsgPart> parts)
id - A unique id for this message (same across all translations).localeString - The language/locale string, or null if unknown. Should only be null for
messages newly extracted from source files. Should always be set for messages parsed from
message files/resources.meaning - The meaning string, or null if not necessary (usually null). This is a string
to create unique messages for two otherwise identical messages. This is usually done for
messages used in different contexts. (For example, the same word can be used as a noun in
one location and as a verb in another location, and the message texts would be the same
but the messages would have meanings of "noun" and "verb".). May not be applicable to all
message plugins.desc - The description for translators.isHidden - Whether this message should be hidden. May not be applicable to all message
plugins.contentType - Content type of the document that this message will appear in
(e.g. "text/html"). May not be applicable to all message plugins.sourcePath - Location of a source file that this message comes from. More sources can
be added using addSourcePath(). May not be applicable to all message plugins.parts - The parts that make up the message content.public SoyMsg(long id,
@Nullable
String localeString,
boolean isPlrselMsg,
List<SoyMsgPart> parts)
id - A unique id for this message (same across all translations).localeString - The language/locale string, or null if unknown. Should only be null for
messages newly extracted from source files. Should always be set for messages parsed from
message files/resources.isPlrselMsg - Whether this is a plural/select message.parts - The parts that make up the message content.public String getLocaleString()
public long getId()
public long getAltId()
public String getMeaning()
public String getDesc()
public boolean isHidden()
public String getContentType()
public void addSourcePath(String sourcePath)
sourcePath - Location of a source file that this message comes from.public com.google.common.collect.ImmutableSet<String> getSourcePaths()
public boolean isPlrselMsg()
public com.google.common.collect.ImmutableList<SoyMsgPart> getParts()