java.lang.Object
ch.qos.logback.core.pattern.Converter<E>
- Type Parameters:
E- The type of the event object
- Direct Known Subclasses:
FormattingConverter,LiteralConverter
A minimal converter which sets up the general interface for derived classes.
It also implements the functionality to chain converters in a linked list.
- Author:
- ceki
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringThe convert method is responsible for extracting data from the event and returning a formatted string representation.getNext()Gets the next converter in the chain.final voidSets the next converter in the chain.voidwrite(StringBuilder buf, E event) Formats the event by calling convert() and appends the resulting string to the provided buffer.
-
Constructor Details
-
Converter
public Converter()
-
-
Method Details
-
convert
The convert method is responsible for extracting data from the event and returning a formatted string representation.- Parameters:
event- the event to convert- Returns:
- the formatted string representation
-
write
Formats the event by calling convert() and appends the resulting string to the provided buffer.- Parameters:
buf- The input buffer where data is appendedevent- The event from where data is extracted
-
setNext
Sets the next converter in the chain. This method can only be called once per converter instance.- Parameters:
next- the next converter to chain- Throws:
IllegalStateException- if next has already been set
-
getNext
Gets the next converter in the chain.- Returns:
- the next converter, or null if not set
-