com.google.javascript.jscomp
Class EmptyMessageBundle

java.lang.Object
  extended by com.google.javascript.jscomp.EmptyMessageBundle
All Implemented Interfaces:
MessageBundle

public class EmptyMessageBundle
extends Object
implements MessageBundle

An implementation of MessageBundle that has no translations.


Constructor Summary
EmptyMessageBundle()
           
 
Method Summary
 Iterable<JsMessage> getAllMessages()
          Returns an empty list of messages.
 JsMessage getMessage(String id)
          Returns null, to indicate it has no message replacements.
 JsMessage.IdGenerator idGenerator()
          Gets a dummy message ID generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyMessageBundle

public EmptyMessageBundle()
Method Detail

idGenerator

public JsMessage.IdGenerator idGenerator()
Gets a dummy message ID generator.

Specified by:
idGenerator in interface MessageBundle
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

public JsMessage getMessage(String id)
Returns null, to indicate it has no message replacements.

Specified by:
getMessage in interface MessageBundle
Parameters:
id - the id of the message being replaced; the key is message ID generated by JsMessage.IdGenerator
Returns:
the message replacement, which may be null.

getAllMessages

public Iterable<JsMessage> getAllMessages()
Returns an empty list of messages.

Specified by:
getAllMessages in interface MessageBundle
Returns:
all messages from this bundle.