Package org.apache.logging.log4j.message
Class SimpleMessageFactory
- java.lang.Object
-
- org.apache.logging.log4j.message.AbstractMessageFactory
-
- org.apache.logging.log4j.message.SimpleMessageFactory
-
- All Implemented Interfaces:
java.io.Serializable
,MessageFactory
,MessageFactory2
public final class SimpleMessageFactory extends AbstractMessageFactory
CreatesFormattedMessage
instances forMessageFactory2
methods (andMessageFactory
by extension.)This uses is the simplest possible implementation of
Message
, the where you give the message to the constructor argument as a String.Creates
StringFormattedMessage
instances fornewMessage(String, Object...)
.This class is immutable.
Note to implementors
This class implements all
MessageFactory2
methods.- Since:
- 2.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleMessageFactory
INSTANCE
Instance of StringFormatterMessageFactory.
-
Constructor Summary
Constructors Constructor Description SimpleMessageFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Message
newMessage(java.lang.String message, java.lang.Object p0)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object... params)
CreatesStringFormattedMessage
instances.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8)
Creates a new parameterized message.Message
newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8, java.lang.Object p9)
Creates a new parameterized message.-
Methods inherited from class org.apache.logging.log4j.message.AbstractMessageFactory
newMessage, newMessage, newMessage
-
-
-
-
Field Detail
-
INSTANCE
public static final SimpleMessageFactory INSTANCE
Instance of StringFormatterMessageFactory.
-
-
Method Detail
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object... params)
CreatesStringFormattedMessage
instances.- Parameters:
message
- The message pattern.params
- The parameters to the message are ignored.- Returns:
- The Message.
- See Also:
MessageFactory.newMessage(String, Object...)
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameterp4
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameterp4
- a message parameterp5
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameterp4
- a message parameterp5
- a message parameterp6
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameterp4
- a message parameterp5
- a message parameterp6
- a message parameterp7
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameterp4
- a message parameterp5
- a message parameterp6
- a message parameterp7
- a message parameterp8
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object p0, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4, java.lang.Object p5, java.lang.Object p6, java.lang.Object p7, java.lang.Object p8, java.lang.Object p9)
Description copied from interface:MessageFactory2
Creates a new parameterized message.- Specified by:
newMessage
in interfaceMessageFactory2
- Overrides:
newMessage
in classAbstractMessageFactory
- Parameters:
message
- a message template, the kind of message template depends on the implementation.p0
- a message parameterp1
- a message parameterp2
- a message parameterp3
- a message parameterp4
- a message parameterp5
- a message parameterp6
- a message parameterp7
- a message parameterp8
- a message parameterp9
- a message parameter- Returns:
- a new message
- Since:
- 2.6.1
- See Also:
ParameterizedMessageFactory
-
-