Class JsonTemplateLayout.StringBuilderEncoder
java.lang.Object
org.apache.logging.log4j.layout.template.json.JsonTemplateLayout.StringBuilderEncoder
- All Implemented Interfaces:
Encoder<StringBuilder>
- Enclosing class:
JsonTemplateLayout
private static final class JsonTemplateLayout.StringBuilderEncoder
extends Object
implements Encoder<StringBuilder>
StringBuilderEncoder clone replacing thread-local allocations with instance fields.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferprivate final CharBufferprivate final Charsetprivate final CharsetEncoder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencode(StringBuilder source, ByteBufferDestination destination) Encodes the specified source object to some binary representation and writes the result to the specified destination.private static voidfallbackEncode(Charset charset, StringBuilder source, ByteBufferDestination destination, Exception error)
-
Field Details
-
charset
-
charsetEncoder
-
charBuffer
-
byteBuffer
-
-
Constructor Details
-
StringBuilderEncoder
-
-
Method Details
-
encode
Description copied from interface:EncoderEncodes the specified source object to some binary representation and writes the result to the specified destination.- Specified by:
encodein interfaceEncoder<StringBuilder>- Parameters:
source- the object to encode.destination- holds the ByteBuffer to write into.
-
fallbackEncode
private static void fallbackEncode(Charset charset, StringBuilder source, ByteBufferDestination destination, Exception error)
-