Package org.bson.json
Class JsonWriter.Context
- java.lang.Object
-
- org.bson.AbstractBsonWriter.Context
-
- org.bson.json.JsonWriter.Context
-
- Enclosing class:
- JsonWriter
public class JsonWriter.Context extends AbstractBsonWriter.Context
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.
-
-
Constructor Summary
Constructors Constructor Description Context(JsonWriter.Context parentContext, BsonContextType contextType)
Creates a new context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonWriter.Context
getParentContext()
Returns the parent context.-
Methods inherited from class org.bson.AbstractBsonWriter.Context
copy, getContextType
-
-
-
-
Constructor Detail
-
Context
public Context(JsonWriter.Context parentContext, BsonContextType contextType)
Creates a new context.- Parameters:
parentContext
- the parent context that can be used for going back up to the parent levelcontextType
- the type of this context
-
-
Method Detail
-
getParentContext
public JsonWriter.Context getParentContext()
Description copied from class:AbstractBsonWriter.Context
Returns the parent context. Allows users of this context object to transition to this parent context.- Overrides:
getParentContext
in classAbstractBsonWriter.Context
- Returns:
- the context that came before this one
-
-