public final class MessageFactory extends Object
Message
instances. This factory is intended to be used
for creating localizable message instances for dynamic vAPI providers or
the vAPI runtime itself.
Messages data (keys, templates) are loaded from ResourceBundle
.
Constructor and Description |
---|
MessageFactory(ResourceBundle resBundle) |
MessageFactory(ResourceBundle resBundle,
TemplateFormatter formatter) |
Modifier and Type | Method and Description |
---|---|
Message |
buildMessage(String id,
String... args)
Return a message object for the given id with the given args.
|
static Message |
getMessage(String id,
String... args)
Return a message object for the given id with the given args.
|
public MessageFactory(ResourceBundle resBundle, TemplateFormatter formatter)
public MessageFactory(ResourceBundle resBundle)
public static Message getMessage(String id, String... args)
buildMessage(String, String...)
public Message buildMessage(String id, String... args)
Message.getDefaultMessage()
of the result instance is formatted
and arguments values are replaced in.
If the message isn't found a default 'unknown' message is returned
id
- identifier for the messageargs
- values for placeholders in the message templateMessage
instance; never null
Copyright © 2015. All Rights Reserved.