public class SoyMsgBundleImpl extends SoyMsgBundle
Important: Only use this class from message plugins!
EMPTY| Constructor and Description |
|---|
SoyMsgBundleImpl(String localeString,
List<SoyMsg> msgs)
Note: If there exist duplicate message ids in the
msgs list, the first one wins. |
| Modifier and Type | Method and Description |
|---|---|
com.ibm.icu.util.ULocale |
getLocale()
Returns the
ULocale of this message bundle. |
String |
getLocaleString()
Gets the language/locale string of this bundle of messages.
|
SoyMsg |
getMsg(long msgId)
Retrieves a message by its unique message id.
|
int |
getNumMsgs()
Gets the number of messages in this bundle.
|
boolean |
isRtl()
Returns
true if this is an RTL (right-to-left) locale. |
Iterator<SoyMsg> |
iterator()
Returns an iterator over all the messages.
|
getMsgPartsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic SoyMsgBundleImpl(@Nullable String localeString, List<SoyMsg> msgs)
msgs list, the first one wins.
However, the source paths from subsequent duplicates will be added to the source paths for the
message.localeString - The language/locale string of this bundle of messages, or null if unknown.
Should only be null for bundles newly extracted from source files. Should always be set for
bundles parsed from message files/resources.msgs - The list of messages. List order will become the iteration order.public String getLocaleString()
SoyMsgBundlegetLocaleString in class SoyMsgBundle@Nullable public com.ibm.icu.util.ULocale getLocale()
SoyMsgBundleULocale of this message bundle. Subclasses are encouraged to override this
to provide efficient implementations.getLocale in class SoyMsgBundlepublic boolean isRtl()
SoyMsgBundletrue if this is an RTL (right-to-left) locale. Subclasses are encouraged to
override this to provide efficient implementations.isRtl in class SoyMsgBundlepublic SoyMsg getMsg(long msgId)
SoyMsgBundlegetMsg in class SoyMsgBundlemsgId - The message id of the message to retrieve.public int getNumMsgs()
SoyMsgBundlegetNumMsgs in class SoyMsgBundlepublic Iterator<SoyMsg> iterator()
SoyMsgBundleiterator in interface Iterable<SoyMsg>iterator in class SoyMsgBundle