Package org.bson
Class AbstractBsonReader.Context
java.lang.Object
org.bson.AbstractBsonReader.Context
- Direct Known Subclasses:
BsonBinaryReader.Context
,BsonDocumentReader.Context
,JsonReader.Context
- Enclosing class:
- AbstractBsonReader
The context for the reader. Records the parent context, creating a bread crumb trail to trace back up to the root context of the
reader. Also records the
BsonContextType
, indicating whether the reader is reading a document, array, or other
complex sub-structure.-
Constructor Summary
ModifierConstructorDescriptionprotected
Context
(AbstractBsonReader.Context parentContext, BsonContextType contextType) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected BsonContextType
Return the type of this context.protected AbstractBsonReader.Context
Returns the parent context.
-
Constructor Details
-
Context
Creates a new instance.- Parameters:
parentContext
- a possibly null value for the context that came before this onecontextType
- the type of this context
-
-
Method Details
-
getParentContext
Returns the parent context. Allows users of this context object to transition to this parent context.- Returns:
- the context that came before this one
-
getContextType
Return the type of this context.- Returns:
- the context type.
-