Top Description Fields Constructors Methods
org.apache.logging.log4j.message

public Class LocalizedMessageFactory

extends AbstractMessageFactory
Class Inheritance
Imports
java.util.ResourceBundle

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Note to implementors:

This class does not implement any MessageFactory2 methods and lets the superclass funnel those calls through newMessage(String, Object...).

Field Summary

Modifier and TypeField and Description
private final String
private final transient ResourceBundle
private static final long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the resource bundle base name if set. May be null.
getBaseName
()

Gets the resource bundle base name if set.

public ResourceBundle

Returns:

the resource bundle if set. May be null.
getResourceBundle
()

Gets the resource bundle if set.

public Message
newMessage(final String
a message String
key
)

Overrides org.apache.logging.log4j.message.AbstractMessageFactory.newMessage.

Implements org.apache.logging.log4j.message.MessageFactory.newMessage.

Creates a new message based on a String.

public Message

Returns:

The LocalizedMessage.
newMessage
(final String
The key String, used as a message if the key is absent.
key
,
final Object...
The parameters for the message at the given key.
params
)

Implements org.apache.logging.log4j.message.MessageFactory.newMessage.

Creates LocalizedMessage instances.

Inherited from org.apache.logging.log4j.message.AbstractMessageFactory:
newMessagenewMessagenewMessagenewMessagenewMessagenewMessagenewMessagenewMessagenewMessagenewMessagenewMessagenewMessage

Field Detail

baseNameback to summary
private final String baseName
resourceBundleback to summary
private final transient ResourceBundle resourceBundle
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.logging.log4j.message.AbstractMessageFactory.serialVersionUID.

Constructor Detail

LocalizedMessageFactoryback to summary
public LocalizedMessageFactory(final ResourceBundle resourceBundle)
LocalizedMessageFactoryback to summary
public LocalizedMessageFactory(final String baseName)

Method Detail

getBaseNameback to summary
public String getBaseName()

Gets the resource bundle base name if set.

Returns:String

the resource bundle base name if set. May be null.

getResourceBundleback to summary
public ResourceBundle getResourceBundle()

Gets the resource bundle if set.

Returns:ResourceBundle

the resource bundle if set. May be null.

newMessageback to summary
public Message newMessage(final String key)

Overrides org.apache.logging.log4j.message.AbstractMessageFactory.newMessage.

Implements org.apache.logging.log4j.message.MessageFactory.newMessage.

Doc from org.apache.logging.log4j.message.MessageFactory.newMessage.

Creates a new message based on a String.

Parameters
key:String

a message String

Returns:Message

a new message

Annotations
@Override
Since
2.8
newMessageback to summary
public Message newMessage(final String key, final Object... params)

Implements org.apache.logging.log4j.message.MessageFactory.newMessage.

Creates LocalizedMessage instances.

Parameters
key:String

The key String, used as a message if the key is absent.

params:Object[]

The parameters for the message at the given key.

Returns:Message

The LocalizedMessage.

Annotations
@Override
See Also
org.apache.logging.log4j.message.MessageFactory#newMessage(String, Object...)