@DoNotMock(value="use the builder() instead to construct a real instance") public abstract class SoyMsg extends Object
This class is heavily optimized for memory usage. In one major server using SoyTofu, Soy messages comprised the single largest category of memory usage prior to optimization. Several fields can be omitted entirely for render-only usage. ImmutableSet and ImmutableList are used because their empty implementations are singletons.
| Modifier and Type | Class and Description |
|---|---|
static class |
SoyMsg.Builder
A builder for SoyMsg.
|
| Constructor and Description |
|---|
SoyMsg() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSourceLocation(SourceLocation sourceLocation) |
static SoyMsg.Builder |
builder()
Returns a new builder for
SoyMsg. |
abstract long |
getAltId()
Returns the alternate unique id for this message, or -1L if not applicable.
|
abstract String |
getContentType()
Returns the content type of the document that this message will appear in.
|
abstract String |
getDesc()
Returns the description for translators.
|
abstract long |
getId()
Returns the unique id for this message (same across all translations).
|
abstract String |
getLocaleString()
Returns the language/locale string.
|
abstract String |
getMeaning()
Returns the meaning string if set, otherwise null (usually null).
|
abstract com.google.common.collect.ImmutableList<SoyMsgPart> |
getParts()
Returns the parts that make up the message content.
|
com.google.common.collect.ImmutableSet<SourceLocation> |
getSourceLocations()
Returns the location(s) of the source file(s) that this message comes from.
|
abstract boolean |
isHidden()
Returns whether this message should be hidden.
|
abstract boolean |
isPlrselMsg()
Returns whether this is a plural/select message.
|
public static SoyMsg.Builder builder()
SoyMsg.@Nullable public abstract String getLocaleString()
public abstract long getId()
public abstract long getAltId()
@Nullable public abstract String getMeaning()
public abstract boolean isHidden()
@Nullable public abstract String getContentType()
public void addSourceLocation(SourceLocation sourceLocation)
sourceLocation - Location of a source file that this message comes from.public com.google.common.collect.ImmutableSet<SourceLocation> getSourceLocations()
public abstract boolean isPlrselMsg()
public abstract com.google.common.collect.ImmutableList<SoyMsgPart> getParts()