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
Nested ClassesModifier and TypeClassDescriptionclassThe 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
ConstructorsConstructorDescriptionJsonDocumentWriter(INodeBuilder nodeBuilder) Creates a new instance which useswriterto write JSON to.JsonDocumentWriter(INodeBuilder nodeBuilder, org.bson.json.JsonWriterSettings settings) Creates a new instance which useswriterto write JSON to and uses the given settings. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected voiddoWriteBinaryData(org.bson.BsonBinary binary) voiddoWriteBoolean(boolean value) protected voiddoWriteDateTime(long value) protected voiddoWriteDBPointer(org.bson.BsonDbPointer value) protected voiddoWriteDecimal128(org.bson.types.Decimal128 value) protected voiddoWriteDouble(double value) protected voidprotected voidprotected voiddoWriteInt32(int value) protected voiddoWriteInt64(long value) protected voiddoWriteJavaScript(String code) protected voidprotected voidprotected voidprotected voiddoWriteName(String name) voidvoiddoWriteObjectId(org.bson.types.ObjectId objectId) voiddoWriteRegularExpression(org.bson.BsonRegularExpression regularExpression) protected voidprotected voidvoiddoWriteString(String value) voiddoWriteSymbol(String value) voiddoWriteTimestamp(org.bson.BsonTimestamp value) voidvoidflush()protected JsonDocumentWriter.ContextbooleanReturn 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 useswriterto write JSON to.- Parameters:
nodeBuilder- the writer to write JSON to.
-
JsonDocumentWriter
Creates a new instance which useswriterto 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:
getContextin classorg.bson.AbstractBsonWriter
-
doWriteName
- Overrides:
doWriteNamein classorg.bson.AbstractBsonWriter
-
doWriteStartDocument
protected void doWriteStartDocument()- Specified by:
doWriteStartDocumentin classorg.bson.AbstractBsonWriter
-
doWriteEndDocument
protected void doWriteEndDocument()- Specified by:
doWriteEndDocumentin classorg.bson.AbstractBsonWriter
-
doWriteStartArray
protected void doWriteStartArray()- Specified by:
doWriteStartArrayin classorg.bson.AbstractBsonWriter
-
doWriteEndArray
protected void doWriteEndArray()- Specified by:
doWriteEndArrayin classorg.bson.AbstractBsonWriter
-
doWriteBinaryData
protected void doWriteBinaryData(org.bson.BsonBinary binary) - Specified by:
doWriteBinaryDatain classorg.bson.AbstractBsonWriter
-
doWriteBoolean
public void doWriteBoolean(boolean value) - Specified by:
doWriteBooleanin classorg.bson.AbstractBsonWriter
-
doWriteDateTime
protected void doWriteDateTime(long value) - Specified by:
doWriteDateTimein classorg.bson.AbstractBsonWriter
-
doWriteDBPointer
protected void doWriteDBPointer(org.bson.BsonDbPointer value) - Specified by:
doWriteDBPointerin classorg.bson.AbstractBsonWriter
-
doWriteDouble
protected void doWriteDouble(double value) - Specified by:
doWriteDoublein classorg.bson.AbstractBsonWriter
-
doWriteInt32
protected void doWriteInt32(int value) - Specified by:
doWriteInt32in classorg.bson.AbstractBsonWriter
-
doWriteInt64
protected void doWriteInt64(long value) - Specified by:
doWriteInt64in classorg.bson.AbstractBsonWriter
-
doWriteDecimal128
protected void doWriteDecimal128(org.bson.types.Decimal128 value) - Specified by:
doWriteDecimal128in classorg.bson.AbstractBsonWriter
-
doWriteJavaScript
- Specified by:
doWriteJavaScriptin classorg.bson.AbstractBsonWriter
-
doWriteJavaScriptWithScope
- Specified by:
doWriteJavaScriptWithScopein classorg.bson.AbstractBsonWriter
-
doWriteMaxKey
protected void doWriteMaxKey()- Specified by:
doWriteMaxKeyin classorg.bson.AbstractBsonWriter
-
doWriteMinKey
protected void doWriteMinKey()- Specified by:
doWriteMinKeyin classorg.bson.AbstractBsonWriter
-
doWriteNull
public void doWriteNull()- Specified by:
doWriteNullin classorg.bson.AbstractBsonWriter
-
doWriteObjectId
public void doWriteObjectId(org.bson.types.ObjectId objectId) - Specified by:
doWriteObjectIdin classorg.bson.AbstractBsonWriter
-
doWriteRegularExpression
public void doWriteRegularExpression(org.bson.BsonRegularExpression regularExpression) - Specified by:
doWriteRegularExpressionin classorg.bson.AbstractBsonWriter
-
doWriteString
- Specified by:
doWriteStringin classorg.bson.AbstractBsonWriter
-
doWriteSymbol
- Specified by:
doWriteSymbolin classorg.bson.AbstractBsonWriter
-
doWriteTimestamp
public void doWriteTimestamp(org.bson.BsonTimestamp value) - Specified by:
doWriteTimestampin classorg.bson.AbstractBsonWriter
-
doWriteUndefined
public void doWriteUndefined()- Specified by:
doWriteUndefinedin classorg.bson.AbstractBsonWriter
-
flush
public void flush()- Specified by:
flushin interfaceorg.bson.BsonWriter- Overrides:
flushin classorg.bson.AbstractBsonWriter
-
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:
-
abortPipe
protected boolean abortPipe()- Overrides:
abortPipein classorg.bson.AbstractBsonWriter
-