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 Classes
    Modifier and Type
    Class
    Description
    class 
    The context for the writer, inheriting all the values from AbstractBsonWriter.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

    Constructors
    Constructor
    Description
    Creates a new instance which uses writer to write JSON to.
    JsonDocumentWriter(INodeBuilder nodeBuilder, org.bson.json.JsonWriterSettings settings)
    Creates a new instance which uses writer to write JSON to and uses the given settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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
     
    protected void
     
    protected void
     
    protected void
     
    protected void
     
    void
     
    void
    doWriteObjectId(org.bson.types.ObjectId objectId)
     
    void
    doWriteRegularExpression(org.bson.BsonRegularExpression regularExpression)
     
    protected void
     
    protected void
     
    void
     
    void
     
    void
    doWriteTimestamp(org.bson.BsonTimestamp value)
     
    void
     
    void
     
     
    boolean
    Return true if the output has been truncated due to exceeding the length specified in JsonWriterSettings.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JsonDocumentWriter

      public JsonDocumentWriter(INodeBuilder nodeBuilder)
      Creates a new instance which uses writer to write JSON to.
      Parameters:
      nodeBuilder - the writer to write JSON to.
    • JsonDocumentWriter

      public JsonDocumentWriter(INodeBuilder nodeBuilder, org.bson.json.JsonWriterSettings settings)
      Creates a new instance which uses writer 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

      protected JsonDocumentWriter.Context getContext()
      Overrides:
      getContext in class org.bson.AbstractBsonWriter
    • doWriteName

      protected void doWriteName(String name)
      Overrides:
      doWriteName in class org.bson.AbstractBsonWriter
    • doWriteStartDocument

      protected void doWriteStartDocument()
      Specified by:
      doWriteStartDocument in class org.bson.AbstractBsonWriter
    • doWriteEndDocument

      protected void doWriteEndDocument()
      Specified by:
      doWriteEndDocument in class org.bson.AbstractBsonWriter
    • doWriteStartArray

      protected void doWriteStartArray()
      Specified by:
      doWriteStartArray in class org.bson.AbstractBsonWriter
    • doWriteEndArray

      protected void doWriteEndArray()
      Specified by:
      doWriteEndArray in class org.bson.AbstractBsonWriter
    • doWriteBinaryData

      protected void doWriteBinaryData(org.bson.BsonBinary binary)
      Specified by:
      doWriteBinaryData in class org.bson.AbstractBsonWriter
    • doWriteBoolean

      public void doWriteBoolean(boolean value)
      Specified by:
      doWriteBoolean in class org.bson.AbstractBsonWriter
    • doWriteDateTime

      protected void doWriteDateTime(long value)
      Specified by:
      doWriteDateTime in class org.bson.AbstractBsonWriter
    • doWriteDBPointer

      protected void doWriteDBPointer(org.bson.BsonDbPointer value)
      Specified by:
      doWriteDBPointer in class org.bson.AbstractBsonWriter
    • doWriteDouble

      protected void doWriteDouble(double value)
      Specified by:
      doWriteDouble in class org.bson.AbstractBsonWriter
    • doWriteInt32

      protected void doWriteInt32(int value)
      Specified by:
      doWriteInt32 in class org.bson.AbstractBsonWriter
    • doWriteInt64

      protected void doWriteInt64(long value)
      Specified by:
      doWriteInt64 in class org.bson.AbstractBsonWriter
    • doWriteDecimal128

      protected void doWriteDecimal128(org.bson.types.Decimal128 value)
      Specified by:
      doWriteDecimal128 in class org.bson.AbstractBsonWriter
    • doWriteJavaScript

      protected void doWriteJavaScript(String code)
      Specified by:
      doWriteJavaScript in class org.bson.AbstractBsonWriter
    • doWriteJavaScriptWithScope

      protected void doWriteJavaScriptWithScope(String code)
      Specified by:
      doWriteJavaScriptWithScope in class org.bson.AbstractBsonWriter
    • doWriteMaxKey

      protected void doWriteMaxKey()
      Specified by:
      doWriteMaxKey in class org.bson.AbstractBsonWriter
    • doWriteMinKey

      protected void doWriteMinKey()
      Specified by:
      doWriteMinKey in class org.bson.AbstractBsonWriter
    • doWriteNull

      public void doWriteNull()
      Specified by:
      doWriteNull in class org.bson.AbstractBsonWriter
    • doWriteObjectId

      public void doWriteObjectId(org.bson.types.ObjectId objectId)
      Specified by:
      doWriteObjectId in class org.bson.AbstractBsonWriter
    • doWriteRegularExpression

      public void doWriteRegularExpression(org.bson.BsonRegularExpression regularExpression)
      Specified by:
      doWriteRegularExpression in class org.bson.AbstractBsonWriter
    • doWriteString

      public void doWriteString(String value)
      Specified by:
      doWriteString in class org.bson.AbstractBsonWriter
    • doWriteSymbol

      public void doWriteSymbol(String value)
      Specified by:
      doWriteSymbol in class org.bson.AbstractBsonWriter
    • doWriteTimestamp

      public void doWriteTimestamp(org.bson.BsonTimestamp value)
      Specified by:
      doWriteTimestamp in class org.bson.AbstractBsonWriter
    • doWriteUndefined

      public void doWriteUndefined()
      Specified by:
      doWriteUndefined in class org.bson.AbstractBsonWriter
    • flush

      public void flush()
    • isTruncated

      public boolean isTruncated()
      Return true if the output has been truncated due to exceeding the length specified in JsonWriterSettings.getMaxLength().
      Returns:
      true if the output has been truncated
      Since:
      3.7
      See Also:
      • JsonWriterSettings.getMaxLength()
    • abortPipe

      protected boolean abortPipe()
      Overrides:
      abortPipe in class org.bson.AbstractBsonWriter