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
protected abstract class AbstractBsonReader.Context extends Object
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 theBsonContextType
, indicating whether the reader is reading a document, array, or other complex sub-structure.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Context(AbstractBsonReader.Context parentContext, BsonContextType contextType)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BsonContextType
getContextType()
Return the type of this context.protected AbstractBsonReader.Context
getParentContext()
Returns the parent context.
-
-
-
Constructor Detail
-
Context
protected Context(AbstractBsonReader.Context parentContext, BsonContextType contextType)
Creates a new instance.- Parameters:
parentContext
- a possibly null value for the context that came before this onecontextType
- the type of this context
-
-
Method Detail
-
getParentContext
protected AbstractBsonReader.Context 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
protected BsonContextType getContextType()
Return the type of this context.- Returns:
- the context type.
-
-