Package com.google.javascript.jscomp
Interface MessageBundle
-
- All Known Implementing Classes:
EmptyMessageBundle
,XtbMessageBundle
public interface MessageBundle
An interface for providing alternative values for user-visible messages in JavaScript code.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<JsMessage>
getAllMessages()
Returns an iterable over the keys that this object has replacements for.JsMessage
getMessage(java.lang.String id)
Gets a message replacement.JsMessage.IdGenerator
idGenerator()
Gets the message ID generator to use to compute message IDs for this type of bundle.
-
-
-
Method Detail
-
idGenerator
JsMessage.IdGenerator idGenerator()
Gets the message ID generator to use to compute message IDs for this type of bundle.- Returns:
- idGenerator instance or null if we do not want to use any custom id generation. In case if idGenerator is null caller should decide how to create id by itself. In the most cases using the message key is enough.
-
getMessage
JsMessage getMessage(java.lang.String id)
Gets a message replacement.- Parameters:
id
- the id of the message being replaced; the key is message ID generated byJsMessage.IdGenerator
- Returns:
- the message replacement, which may be null.
-
getAllMessages
java.lang.Iterable<JsMessage> getAllMessages()
Returns an iterable over the keys that this object has replacements for.- Returns:
- all messages from this bundle.
-
-