public class JsonReader extends AbstractBsonReader
| Modifier and Type | Class and Description |
|---|---|
protected class |
JsonReader.Context |
protected class |
JsonReader.Mark |
AbstractBsonReader.State| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
currentValue |
private JsonReader.Mark |
mark |
private JsonToken |
pushedToken |
private JsonScanner |
scanner |
| Constructor and Description |
|---|
JsonReader(java.lang.String json)
Constructs a new instance with the given JSON string.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
doPeekBinarySize()
Handles the logic to peek at the binary size.
|
protected byte |
doPeekBinarySubType()
Handles the logic to peek at the binary subtype.
|
protected BsonBinary |
doReadBinaryData()
Handles the logic to read binary data
|
protected boolean |
doReadBoolean()
Handles the logic to read booleans
|
protected long |
doReadDateTime()
Handles the logic to read date time
|
protected BsonDbPointer |
doReadDBPointer()
Handles the logic to read a DBPointer
|
Decimal128 |
doReadDecimal128()
Handles the logic to read Decimal128
|
protected double |
doReadDouble()
Handles the logic to read doubles
|
protected void |
doReadEndArray()
Handles the logic when reading the end of an array
|
protected void |
doReadEndDocument()
Handles the logic when reading the end of a document
|
protected int |
doReadInt32()
Handles the logic to read 32 bit ints
|
protected long |
doReadInt64()
Handles the logic to read 64 bit ints
|
protected java.lang.String |
doReadJavaScript()
Handles the logic to read Javascript functions
|
protected java.lang.String |
doReadJavaScriptWithScope()
Handles the logic to read scoped Javascript functions
|
protected void |
doReadMaxKey()
Handles the logic to read a Max key
|
protected void |
doReadMinKey()
Handles the logic to read a Min key
|
protected void |
doReadNull()
Handles the logic to read a null value
|
protected ObjectId |
doReadObjectId()
Handles the logic to read an ObjectId
|
protected BsonRegularExpression |
doReadRegularExpression()
Handles the logic to read a regular expression
|
protected void |
doReadStartArray()
Handles the logic to read the start of an array
|
protected void |
doReadStartDocument()
Handles the logic to read the start of a document
|
protected java.lang.String |
doReadString()
Handles the logic to read a String
|
protected java.lang.String |
doReadSymbol()
Handles the logic to read a Symbol
|
protected BsonTimestamp |
doReadTimestamp()
Handles the logic to read a timestamp
|
protected void |
doReadUndefined()
Handles the logic to read an Undefined value
|
protected void |
doSkipName()
Handles any logic required to skip the name (reader must be positioned on a name).
|
protected void |
doSkipValue()
Handles any logic required to skip the value (reader must be positioned on a value).
|
protected JsonReader.Context |
getContext()
Get the context, which will indicate which state the reader is in, for example which part of a document it's currently reading.
|
void |
mark()
Creates a bookmark in the BsonReader's input
The previous mark must be cleared before creating a new one
|
private JsonToken |
popToken() |
private void |
pushToken(JsonToken token) |
BsonType |
readBsonType()
Reads a BSONType from the reader.
|
void |
reset()
Go back to the state at the last mark and removes the mark
|
private void |
verifyString(java.lang.String expected) |
private void |
verifyToken(java.lang.Object expected) |
private BsonBinary |
visitBinDataConstructor() |
private BsonBinary |
visitBinDataExtendedJson() |
private long |
visitDateTimeConstructor() |
private java.lang.String |
visitDateTimeConstructorWithOutNew() |
private long |
visitDateTimeExtendedJson() |
private BsonDbPointer |
visitDBPointerConstructor() |
private void |
visitExtendedJSON() |
private BsonBinary |
visitHexDataConstructor() |
private long |
visitISODateTimeConstructor() |
private void |
visitJavaScriptExtendedJson() |
private MaxKey |
visitMaxKeyExtendedJson() |
private MinKey |
visitMinKeyExtendedJson() |
private void |
visitNew() |
private Decimal128 |
visitNumberDecimalConstructor() |
private Decimal128 |
visitNumberDecimalExtendedJson() |
private long |
visitNumberLongConstructor() |
private java.lang.Long |
visitNumberLongExtendedJson() |
private ObjectId |
visitObjectIdConstructor() |
private ObjectId |
visitObjectIdExtendedJson() |
private BsonRegularExpression |
visitRegularExpressionConstructor() |
private BsonRegularExpression |
visitRegularExpressionExtendedJson() |
private java.lang.String |
visitSymbolExtendedJson() |
private BsonTimestamp |
visitTimestampConstructor() |
private BsonTimestamp |
visitTimestampExtendedJson() |
private BsonUndefined |
visitUndefinedExtendedJson() |
private BsonBinary |
visitUUIDConstructor(java.lang.String uuidConstructorName) |
checkPreconditions, close, getCurrentBsonType, getCurrentName, getNextState, getState, isClosed, peekBinarySize, peekBinarySubType, readBinaryData, readBinaryData, readBoolean, readBoolean, readDateTime, readDateTime, readDBPointer, readDBPointer, readDecimal128, readDecimal128, readDouble, readDouble, readEndArray, readEndDocument, readInt32, readInt32, readInt64, readInt64, readJavaScript, readJavaScript, readJavaScriptWithScope, readJavaScriptWithScope, readMaxKey, readMaxKey, readMinKey, readMinKey, readName, readName, readNull, readNull, readObjectId, readObjectId, readRegularExpression, readRegularExpression, readStartArray, readStartDocument, readString, readString, readSymbol, readSymbol, readTimestamp, readTimestamp, readUndefined, readUndefined, setContext, setCurrentBsonType, setCurrentName, setState, skipName, skipValue, throwInvalidContextType, throwInvalidState, verifyBSONType, verifyNameprivate final JsonScanner scanner
private JsonToken pushedToken
private java.lang.Object currentValue
private JsonReader.Mark mark
public JsonReader(java.lang.String json)
json - A string representation of a JSON.protected BsonBinary doReadBinaryData()
AbstractBsonReaderdoReadBinaryData in class AbstractBsonReaderprotected byte doPeekBinarySubType()
AbstractBsonReaderdoPeekBinarySubType in class AbstractBsonReaderprotected int doPeekBinarySize()
AbstractBsonReaderdoPeekBinarySize in class AbstractBsonReaderprotected boolean doReadBoolean()
AbstractBsonReaderdoReadBoolean in class AbstractBsonReaderpublic BsonType readBsonType()
BsonReaderreadBsonType in interface BsonReaderreadBsonType in class AbstractBsonReaderpublic Decimal128 doReadDecimal128()
AbstractBsonReaderdoReadDecimal128 in class AbstractBsonReaderprotected long doReadDateTime()
AbstractBsonReaderdoReadDateTime in class AbstractBsonReaderprotected double doReadDouble()
AbstractBsonReaderdoReadDouble in class AbstractBsonReaderprotected void doReadEndArray()
AbstractBsonReaderdoReadEndArray in class AbstractBsonReaderprotected void doReadEndDocument()
AbstractBsonReaderdoReadEndDocument in class AbstractBsonReaderprotected int doReadInt32()
AbstractBsonReaderdoReadInt32 in class AbstractBsonReaderprotected long doReadInt64()
AbstractBsonReaderdoReadInt64 in class AbstractBsonReaderprotected java.lang.String doReadJavaScript()
AbstractBsonReaderdoReadJavaScript in class AbstractBsonReaderprotected java.lang.String doReadJavaScriptWithScope()
AbstractBsonReaderdoReadJavaScriptWithScope in class AbstractBsonReaderprotected void doReadMaxKey()
AbstractBsonReaderdoReadMaxKey in class AbstractBsonReaderprotected void doReadMinKey()
AbstractBsonReaderdoReadMinKey in class AbstractBsonReaderprotected void doReadNull()
AbstractBsonReaderdoReadNull in class AbstractBsonReaderprotected ObjectId doReadObjectId()
AbstractBsonReaderdoReadObjectId in class AbstractBsonReaderprotected BsonRegularExpression doReadRegularExpression()
AbstractBsonReaderdoReadRegularExpression in class AbstractBsonReaderprotected BsonDbPointer doReadDBPointer()
AbstractBsonReaderdoReadDBPointer in class AbstractBsonReaderprotected void doReadStartArray()
AbstractBsonReaderdoReadStartArray in class AbstractBsonReaderprotected void doReadStartDocument()
AbstractBsonReaderdoReadStartDocument in class AbstractBsonReaderprotected java.lang.String doReadString()
AbstractBsonReaderdoReadString in class AbstractBsonReaderprotected java.lang.String doReadSymbol()
AbstractBsonReaderdoReadSymbol in class AbstractBsonReaderprotected BsonTimestamp doReadTimestamp()
AbstractBsonReaderdoReadTimestamp in class AbstractBsonReaderprotected void doReadUndefined()
AbstractBsonReaderdoReadUndefined in class AbstractBsonReaderprotected void doSkipName()
AbstractBsonReaderdoSkipName in class AbstractBsonReaderprotected void doSkipValue()
AbstractBsonReaderdoSkipValue in class AbstractBsonReaderprivate JsonToken popToken()
private void pushToken(JsonToken token)
private void verifyToken(java.lang.Object expected)
private void verifyString(java.lang.String expected)
private void visitNew()
private void visitExtendedJSON()
private BsonBinary visitBinDataConstructor()
private BsonBinary visitUUIDConstructor(java.lang.String uuidConstructorName)
private BsonRegularExpression visitRegularExpressionConstructor()
private ObjectId visitObjectIdConstructor()
private BsonTimestamp visitTimestampConstructor()
private BsonDbPointer visitDBPointerConstructor()
private long visitNumberLongConstructor()
private Decimal128 visitNumberDecimalConstructor()
private long visitISODateTimeConstructor()
private BsonBinary visitHexDataConstructor()
private long visitDateTimeConstructor()
private java.lang.String visitDateTimeConstructorWithOutNew()
private BsonBinary visitBinDataExtendedJson()
private long visitDateTimeExtendedJson()
private MaxKey visitMaxKeyExtendedJson()
private MinKey visitMinKeyExtendedJson()
private ObjectId visitObjectIdExtendedJson()
private BsonRegularExpression visitRegularExpressionExtendedJson()
private java.lang.String visitSymbolExtendedJson()
private BsonTimestamp visitTimestampExtendedJson()
private void visitJavaScriptExtendedJson()
private BsonUndefined visitUndefinedExtendedJson()
private java.lang.Long visitNumberLongExtendedJson()
private Decimal128 visitNumberDecimalExtendedJson()
public void mark()
BsonReaderpublic void reset()
BsonReaderprotected JsonReader.Context getContext()
AbstractBsonReadergetContext in class AbstractBsonReader