Package org.bson.json
Class JsonReader
- java.lang.Object
-
- org.bson.AbstractBsonReader
-
- org.bson.json.JsonReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,BsonReader
public class JsonReader extends AbstractBsonReader
Reads a JSON in one of the following modes:- Strict mode that conforms to the JSON RFC specifications.
- JavaScript mode that that most JavaScript interpreters can process
- Shell mode that the mongo shell can process. This is also called "extended" JavaScript format.
- Since:
- 3.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bson.AbstractBsonReader
AbstractBsonReader.State
-
-
Constructor Summary
Constructors Constructor Description JsonReader(java.lang.String json)Constructs a new instance with the given JSON string.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Decimal128doReadDecimal128()BsonReaderMarkgetMark()Gets a mark representing the current state of the reader.voidmark()Deprecated.BsonTypereadBsonType()Reads a BSONType from the reader.voidreset()Go back to the state at the last mark and removes the mark-
Methods inherited from class org.bson.AbstractBsonReader
close, getCurrentBsonType, getCurrentName, getState, 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, skipName, skipValue
-
-
-
-
Method Detail
-
readBsonType
public BsonType readBsonType()
Description copied from interface:BsonReaderReads a BSONType from the reader.- Specified by:
readBsonTypein interfaceBsonReader- Specified by:
readBsonTypein classAbstractBsonReader- Returns:
- A BSONType.
-
doReadDecimal128
public Decimal128 doReadDecimal128()
-
mark
@Deprecated public void mark()
Deprecated.Description copied from interface:BsonReaderCreates a bookmark in the BsonReader's input The previous mark must be cleared before creating a new one
-
getMark
public BsonReaderMark getMark()
Description copied from interface:BsonReaderGets a mark representing the current state of the reader.- Returns:
- the mark
-
reset
public void reset()
Description copied from interface:BsonReaderGo back to the state at the last mark and removes the mark
-
-