Package org.frankframework.mongodb
Class JsonDocumentWriter
java.lang.Object
org.bson.AbstractBsonWriter
org.frankframework.mongodb.JsonDocumentWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.bson.BsonWriter
public class JsonDocumentWriter
extends org.bson.AbstractBsonWriter
BSON writer to write to FF DocumentBuilder, to generate JSON or XML.
Based on org.bson.json.JsonWriter, called in Document.toJson();
- Author:
- Gerrit van Brakel
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
The context for the writer, inheriting all the values fromAbstractBsonWriter.Context
, and additionally providing settings for the indentation level and whether there are any child elements at this level.Nested classes/interfaces inherited from class org.bson.AbstractBsonWriter
org.bson.AbstractBsonWriter.Mark, org.bson.AbstractBsonWriter.State
-
Constructor Summary
ConstructorDescriptionJsonDocumentWriter
(INodeBuilder nodeBuilder) Creates a new instance which useswriter
to write JSON to.JsonDocumentWriter
(INodeBuilder nodeBuilder, org.bson.json.JsonWriterSettings settings) Creates a new instance which useswriter
to write JSON to and uses the given settings. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected void
doWriteBinaryData
(org.bson.BsonBinary binary) void
doWriteBoolean
(boolean value) protected void
doWriteDateTime
(long value) protected void
doWriteDBPointer
(org.bson.BsonDbPointer value) protected void
doWriteDecimal128
(org.bson.types.Decimal128 value) protected void
doWriteDouble
(double value) protected void
protected void
protected void
doWriteInt32
(int value) protected void
doWriteInt64
(long value) protected void
doWriteJavaScript
(String code) protected void
protected void
protected void
protected void
doWriteName
(String name) void
void
doWriteObjectId
(org.bson.types.ObjectId objectId) void
doWriteRegularExpression
(org.bson.BsonRegularExpression regularExpression) protected void
protected void
void
doWriteString
(String value) void
doWriteSymbol
(String value) void
doWriteTimestamp
(org.bson.BsonTimestamp value) void
void
flush()
protected JsonDocumentWriter.Context
boolean
Return true if the output has been truncated due to exceeding the length specified inJsonWriterSettings.getMaxLength()
.Methods inherited from class org.bson.AbstractBsonWriter
checkPreconditions, checkState, close, getName, getNextState, getState, isClosed, pipe, pipe, pipeExtraElements, setContext, setState, throwInvalidContextType, throwInvalidState, writeBinaryData, writeBinaryData, writeBoolean, writeBoolean, writeDateTime, writeDateTime, writeDBPointer, writeDBPointer, writeDecimal128, writeDecimal128, writeDouble, writeDouble, writeEndArray, writeEndDocument, writeInt32, writeInt32, writeInt64, writeInt64, writeJavaScript, writeJavaScript, writeJavaScriptWithScope, writeJavaScriptWithScope, writeMaxKey, writeMaxKey, writeMinKey, writeMinKey, writeName, writeNull, writeNull, writeObjectId, writeObjectId, writeRegularExpression, writeRegularExpression, writeStartArray, writeStartArray, writeStartDocument, writeStartDocument, writeString, writeString, writeSymbol, writeSymbol, writeTimestamp, writeTimestamp, writeUndefined, writeUndefined
-
Constructor Details
-
JsonDocumentWriter
Creates a new instance which useswriter
to write JSON to.- Parameters:
nodeBuilder
- the writer to write JSON to.
-
JsonDocumentWriter
Creates a new instance which useswriter
to write JSON to and uses the given settings.- Parameters:
nodeBuilder
- the handler to write JSON to.settings
- the settings to apply to this writer.
-
-
Method Details
-
getContext
- Overrides:
getContext
in classorg.bson.AbstractBsonWriter
-
doWriteName
- Overrides:
doWriteName
in classorg.bson.AbstractBsonWriter
-
doWriteStartDocument
protected void doWriteStartDocument()- Specified by:
doWriteStartDocument
in classorg.bson.AbstractBsonWriter
-
doWriteEndDocument
protected void doWriteEndDocument()- Specified by:
doWriteEndDocument
in classorg.bson.AbstractBsonWriter
-
doWriteStartArray
protected void doWriteStartArray()- Specified by:
doWriteStartArray
in classorg.bson.AbstractBsonWriter
-
doWriteEndArray
protected void doWriteEndArray()- Specified by:
doWriteEndArray
in classorg.bson.AbstractBsonWriter
-
doWriteBinaryData
protected void doWriteBinaryData(org.bson.BsonBinary binary) - Specified by:
doWriteBinaryData
in classorg.bson.AbstractBsonWriter
-
doWriteBoolean
public void doWriteBoolean(boolean value) - Specified by:
doWriteBoolean
in classorg.bson.AbstractBsonWriter
-
doWriteDateTime
protected void doWriteDateTime(long value) - Specified by:
doWriteDateTime
in classorg.bson.AbstractBsonWriter
-
doWriteDBPointer
protected void doWriteDBPointer(org.bson.BsonDbPointer value) - Specified by:
doWriteDBPointer
in classorg.bson.AbstractBsonWriter
-
doWriteDouble
protected void doWriteDouble(double value) - Specified by:
doWriteDouble
in classorg.bson.AbstractBsonWriter
-
doWriteInt32
protected void doWriteInt32(int value) - Specified by:
doWriteInt32
in classorg.bson.AbstractBsonWriter
-
doWriteInt64
protected void doWriteInt64(long value) - Specified by:
doWriteInt64
in classorg.bson.AbstractBsonWriter
-
doWriteDecimal128
protected void doWriteDecimal128(org.bson.types.Decimal128 value) - Specified by:
doWriteDecimal128
in classorg.bson.AbstractBsonWriter
-
doWriteJavaScript
- Specified by:
doWriteJavaScript
in classorg.bson.AbstractBsonWriter
-
doWriteJavaScriptWithScope
- Specified by:
doWriteJavaScriptWithScope
in classorg.bson.AbstractBsonWriter
-
doWriteMaxKey
protected void doWriteMaxKey()- Specified by:
doWriteMaxKey
in classorg.bson.AbstractBsonWriter
-
doWriteMinKey
protected void doWriteMinKey()- Specified by:
doWriteMinKey
in classorg.bson.AbstractBsonWriter
-
doWriteNull
public void doWriteNull()- Specified by:
doWriteNull
in classorg.bson.AbstractBsonWriter
-
doWriteObjectId
public void doWriteObjectId(org.bson.types.ObjectId objectId) - Specified by:
doWriteObjectId
in classorg.bson.AbstractBsonWriter
-
doWriteRegularExpression
public void doWriteRegularExpression(org.bson.BsonRegularExpression regularExpression) - Specified by:
doWriteRegularExpression
in classorg.bson.AbstractBsonWriter
-
doWriteString
- Specified by:
doWriteString
in classorg.bson.AbstractBsonWriter
-
doWriteSymbol
- Specified by:
doWriteSymbol
in classorg.bson.AbstractBsonWriter
-
doWriteTimestamp
public void doWriteTimestamp(org.bson.BsonTimestamp value) - Specified by:
doWriteTimestamp
in classorg.bson.AbstractBsonWriter
-
doWriteUndefined
public void doWriteUndefined()- Specified by:
doWriteUndefined
in classorg.bson.AbstractBsonWriter
-
flush
public void flush() -
isTruncated
public boolean isTruncated()Return true if the output has been truncated due to exceeding the length specified inJsonWriterSettings.getMaxLength()
.- Returns:
- true if the output has been truncated
- Since:
- 3.7
- See Also:
-
JsonWriterSettings.getMaxLength()
-
abortPipe
protected boolean abortPipe()- Overrides:
abortPipe
in classorg.bson.AbstractBsonWriter
-