Class JsonWriter.Context

  • Enclosing class:
    JsonWriter

    public class JsonWriter.Context
    extends org.bson.AbstractBsonWriter.Context
    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.
    • Constructor Summary

      Constructors 
      Constructor Description
      Context​(JsonWriter.Context parentContext, org.bson.BsonContextType contextType, java.lang.String indentChars)
      Creates a new context.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JsonWriter.Context getParentContext()  
      • Methods inherited from class org.bson.AbstractBsonWriter.Context

        copy, getContextType
      • Methods inherited from class java.lang.Object

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

      • Context

        public Context​(JsonWriter.Context parentContext,
                       org.bson.BsonContextType contextType,
                       java.lang.String indentChars)
        Creates a new context.
        Parameters:
        parentContext - the parent context that can be used for going back up to the parent level
        contextType - the type of this context
        indentChars - the String to use for indentation at this level.
    • Method Detail

      • getParentContext

        public JsonWriter.Context getParentContext()
        Overrides:
        getParentContext in class org.bson.AbstractBsonWriter.Context