public class LocalizedMessageFactory extends AbstractMessageFactory
FormattedMessage
instances for MessageFactory2
methods (and MessageFactory
by
extension.)
This class does not implement any MessageFactory2
methods and lets the superclass funnel those calls
through newMessage(String, Object...)
.
Constructor and Description |
---|
LocalizedMessageFactory(ResourceBundle resourceBundle) |
LocalizedMessageFactory(String baseName) |
Modifier and Type | Method and Description |
---|---|
String |
getBaseName()
Gets the resource bundle base name if set.
|
ResourceBundle |
getResourceBundle()
Gets the resource bundle if set.
|
Message |
newMessage(String key)
Creates a new message based on a String.
|
Message |
newMessage(String key,
Object... params)
Creates
LocalizedMessage instances. |
newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage
public LocalizedMessageFactory(ResourceBundle resourceBundle)
public LocalizedMessageFactory(String baseName)
public String getBaseName()
public ResourceBundle getResourceBundle()
public Message newMessage(String key)
MessageFactory
newMessage
in interface MessageFactory
newMessage
in class AbstractMessageFactory
key
- a message Stringpublic Message newMessage(String key, Object... params)
LocalizedMessage
instances.key
- The key String, used as a message if the key is absent.params
- The parameters for the message at the given key.MessageFactory.newMessage(String, Object...)
Copyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.