public abstract class CompositeJsonEncoder<Event extends DeferredProcessingAware> extends EncoderBase<Event> implements StreamingEncoder<Event>
startedcontext| Constructor and Description |
|---|
CompositeJsonEncoder() |
isStartedaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextprotected abstract AbstractCompositeJsonFormatter<Event> createFormatter()
public void encode(Event event, OutputStream outputStream) throws IOException
encode in interface StreamingEncoder<Event extends DeferredProcessingAware>IOExceptionpublic byte[] encode(Event event)
encode in interface Encoder<Event extends DeferredProcessingAware>public void start()
start in interface LifeCyclestart in class EncoderBase<Event extends DeferredProcessingAware>public void stop()
stop in interface LifeCyclestop in class EncoderBase<Event extends DeferredProcessingAware>public byte[] headerBytes()
headerBytes in interface Encoder<Event extends DeferredProcessingAware>public byte[] footerBytes()
footerBytes in interface Encoder<Event extends DeferredProcessingAware>public JsonProviders<Event> getProviders()
public void setProviders(JsonProviders<Event> jsonProviders)
public JsonFactoryDecorator getJsonFactoryDecorator()
public void setJsonFactoryDecorator(JsonFactoryDecorator jsonFactoryDecorator)
public JsonGeneratorDecorator getJsonGeneratorDecorator()
public String getEncoding()
public void setEncoding(String encodingName)
UTF-8").
Must an encoding supported by JsonEncodingencodingName - encoding namepublic void setFindAndRegisterJacksonModules(boolean findAndRegisterJacksonModules)
public void setJsonGeneratorDecorator(JsonGeneratorDecorator jsonGeneratorDecorator)
public String getLineSeparator()
public void setLineSeparator(String lineSeparator)
The following values have special meaning:
null or empty string = no new line.SYSTEM" = operating system new line (default).UNIX" = unix line ending (\n).WINDOWS" = windows line ending \r\n).Any other value will be used as given as the lineSeparator.
lineSeparator - the line separatorpublic int getMinBufferSize()
public void setMinBufferSize(int minBufferSize)
The buffer automatically grows above the #minBufferSize when needed to
accommodate with larger events. However, only the first minBufferSize bytes
will be reused by subsequent invocations. It is therefore strongly advised to set
the minimum size at least equal to the average size of the encoded events to reduce
unnecessary memory allocations and reduce pressure on the garbage collector.
Note: changes to the buffer size will not be taken into account after the encoder is started.
minBufferSize - minimum size of the byte buffer (in bytes)protected AbstractCompositeJsonFormatter<Event> getFormatter()
Copyright © 2013–2021. All rights reserved.