public class BsonParser
extends com.fasterxml.jackson.core.base.ParserBase
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BsonParser.BsonLocation
Extends
JsonLocation to offer a specialized string representation |
protected static class |
BsonParser.Context
Information about the element currently begin parsed
|
static class |
BsonParser.Feature
Defines toggable features
|
protected static class |
BsonParser.State
Specifies what the parser is currently parsing (field name or value) or
if it is done with the current element
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
_bsonFeatures
The features for this parser
|
protected boolean |
_closed
True if the parser has been closed
|
protected com.fasterxml.jackson.core.ObjectCodec |
_codec
The ObjectCodec used to parse the Bson object(s)
|
protected CountingInputStream |
_counter
Counts the number of bytes read from
_in |
protected BsonParser.Context |
_currentContext
The current parser state
|
protected LittleEndianInputStream |
_in
The input stream to read from
|
protected java.io.InputStream |
_rawInputStream
The raw input stream passed in
|
protected int |
_tokenPos
The position of the current token
|
_binaryValue, _byteArrayBuilder, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _ioContext, _nameCopied, _nameCopyBuffer, _nextToken, _numberBigDecimal, _numberBigInt, _numberDouble, _numberInt, _numberLong, _numberNegative, _numTypesValid, _parsingContext, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal, JSON_READ_CAPABILITIES_currToken, _lastClearedToken, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_TAB, MAX_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN| Constructor and Description |
|---|
BsonParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int jsonFeatures,
int bsonFeatures,
java.io.InputStream in)
Constructs a new parser
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_closeInput() |
protected void |
_finishString() |
protected void |
_handleEOF() |
void |
close() |
java.math.BigInteger |
getBigIntegerValue() |
byte[] |
getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant) |
com.fasterxml.jackson.core.ObjectCodec |
getCodec() |
protected BsonParser.Context |
getContext() |
byte |
getCurrentBsonType() |
com.fasterxml.jackson.core.JsonLocation |
getCurrentLocation() |
java.lang.String |
getCurrentName() |
java.math.BigDecimal |
getDecimalValue() |
double |
getDoubleValue() |
java.lang.Object |
getEmbeddedObject() |
float |
getFloatValue() |
int |
getIntValue() |
long |
getLongValue() |
com.fasterxml.jackson.core.JsonParser.NumberType |
getNumberType() |
java.lang.Number |
getNumberValue() |
java.lang.Number |
getNumberValueExact() |
java.lang.String |
getText() |
char[] |
getTextCharacters() |
int |
getTextLength() |
int |
getTextOffset() |
com.fasterxml.jackson.core.JsonLocation |
getTokenLocation() |
protected com.fasterxml.jackson.core.JsonToken |
handleBinary()
Reads binary data from the input stream
|
protected com.fasterxml.jackson.core.JsonToken |
handleDBPointer()
Reads a DBPointer from the stream
|
protected com.fasterxml.jackson.core.JsonToken |
handleJavascriptWithScope()
Can be called when embedded javascript code with scope is found.
|
protected com.fasterxml.jackson.core.JsonToken |
handleNewDocument(boolean array)
Can be called when a new embedded document is found.
|
protected com.fasterxml.jackson.core.JsonToken |
handleRegEx()
Reads and compiles a regular expression
|
boolean |
hasTextCharacters() |
boolean |
isClosed() |
protected boolean |
isEnabled(BsonParser.Feature f)
Checks if a generator feature is enabled
|
boolean |
isExpectedStartArrayToken() |
protected boolean |
loadMore() |
com.fasterxml.jackson.core.JsonToken |
nextToken() |
protected java.lang.String |
readCString() |
protected java.util.Map<java.lang.String,java.lang.Object> |
readDocument()
Fully reads an embedded document, reusing this parser
|
protected ObjectId |
readObjectId()
Reads a ObjectID from the input stream
|
protected java.lang.String |
readString()
Reads a string that consists of a integer denoting the number of bytes,
the bytes (including a terminating 0 byte)
|
protected Symbol |
readSymbol()
Reads a symbol object from the input stream
|
protected Timestamp |
readTimestamp()
Reads a timestamp object from the input stream
|
protected int |
regexStrToFlags(java.lang.String pattern)
Converts a BSON regex pattern string to a combined value of Java flags that
can be used in
Pattern.compile(String, int) |
void |
setCodec(com.fasterxml.jackson.core.ObjectCodec c) |
protected void |
skipCString()
Skips over a null-terminated string in the input stream
|
_checkStdFeatureChanges, _contentReference, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _getByteArrayBuilder, _getSourceReference, _handleBase64MissingPadding, _handleUnrecognizedCharacterEscape, _parseIntValue, _parseNumericValue, _releaseBuffers, _reportMismatchedEndMarker, _reportTooLongIntegral, _throwUnquotedSpace, _validJsonTokenList, _validJsonValueList, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToInt, convertNumberToLong, disable, enable, getCurrentValue, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, isNaN, loadMoreGuaranteed, overrideCurrentName, overrideStdFeatures, reportInvalidBase64Char, reportInvalidBase64Char, reset, resetAsNaN, resetFloat, resetInt, setCurrentValue, setFeatureMask, version_ascii, _asciiBytes, _constructError, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartObjectToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, skipChildren_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, assignCurrentValue, canParseAsync, canReadObjectId, canReadTypeId, canUseSchema, configure, currentLocation, currentName, currentTokenLocation, currentValue, finishToken, getBinaryValue, getBooleanValue, getByteValue, getFeatureMask, getFormatFeatures, getInputSource, getNonBlockingInputFeeder, getObjectId, getReadCapabilities, getSchema, getShortValue, getText, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideFormatFeatures, readBinaryValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, requiresCustomCodec, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchemaprotected int _bsonFeatures
protected LittleEndianInputStream _in
protected CountingInputStream _counter
_inprotected java.io.InputStream _rawInputStream
protected boolean _closed
protected com.fasterxml.jackson.core.ObjectCodec _codec
protected int _tokenPos
protected BsonParser.Context _currentContext
public BsonParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int jsonFeatures,
int bsonFeatures,
java.io.InputStream in)
ctxt - the Jackson IO contextjsonFeatures - bit flag composed of bits that indicate which
JsonParser.Features are enabled.bsonFeatures - bit flag composed of bits that indicate which
BsonParser.Features are enabled.in - the input stream to parse.protected boolean isEnabled(BsonParser.Feature f)
f - the featurepublic boolean isExpectedStartArrayToken()
isExpectedStartArrayToken in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic com.fasterxml.jackson.core.ObjectCodec getCodec()
getCodec in class com.fasterxml.jackson.core.JsonParserpublic void setCodec(com.fasterxml.jackson.core.ObjectCodec c)
setCodec in class com.fasterxml.jackson.core.JsonParserpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic com.fasterxml.jackson.core.JsonToken nextToken()
throws java.io.IOException
nextToken in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOExceptionprotected com.fasterxml.jackson.core.JsonToken handleNewDocument(boolean array)
throws java.io.IOException
array - true if the document is an embedded arrayjava.io.IOException - if an I/O error occursprotected com.fasterxml.jackson.core.JsonToken handleBinary()
throws java.io.IOException
java.io.IOException - if an I/O error occursprotected int regexStrToFlags(java.lang.String pattern)
throws com.fasterxml.jackson.core.JsonParseException
Pattern.compile(String, int)pattern - the regex pattern stringcom.fasterxml.jackson.core.JsonParseException - if the pattern string contains a unsupported flagprotected com.fasterxml.jackson.core.JsonToken handleRegEx()
throws java.io.IOException
java.io.IOException - if an I/O error occursprotected com.fasterxml.jackson.core.JsonToken handleDBPointer()
throws java.io.IOException
java.io.IOException - if an I/O error occursprotected com.fasterxml.jackson.core.JsonToken handleJavascriptWithScope()
throws java.io.IOException
java.io.IOException - if an I/O error occursprotected java.lang.String readCString()
throws java.io.IOException
java.io.IOException - if the string could not be readprotected void skipCString()
throws java.io.IOException
java.io.IOException - if an I/O error occursprotected java.lang.String readString()
throws java.io.IOException
java.io.IOException - if the string could not be readprotected Symbol readSymbol() throws java.io.IOException
java.io.IOException - if the symbol could not be readprotected Timestamp readTimestamp() throws java.io.IOException
java.io.IOException - if the timestamp could not be readprotected ObjectId readObjectId() throws java.io.IOException
java.io.IOException - if the ObjectID could not be readprotected java.util.Map<java.lang.String,java.lang.Object> readDocument()
throws java.io.IOException
java.io.IOException - if the document could not be readprotected BsonParser.Context getContext() throws java.io.IOException
java.io.IOException - if there is no contextpublic boolean isClosed()
isClosed in class com.fasterxml.jackson.core.base.ParserBasepublic java.lang.String getCurrentName()
getCurrentName in class com.fasterxml.jackson.core.base.ParserBasepublic byte getCurrentBsonType()
public com.fasterxml.jackson.core.JsonLocation getTokenLocation()
getTokenLocation in class com.fasterxml.jackson.core.base.ParserBasepublic com.fasterxml.jackson.core.JsonLocation getCurrentLocation()
getCurrentLocation in class com.fasterxml.jackson.core.base.ParserBasepublic java.lang.String getText()
getText in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic char[] getTextCharacters()
getTextCharacters in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic int getTextLength()
getTextLength in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic int getTextOffset()
getTextOffset in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic boolean hasTextCharacters()
hasTextCharacters in class com.fasterxml.jackson.core.base.ParserBasepublic java.lang.Number getNumberValue()
throws java.io.IOException
getNumberValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic java.lang.Number getNumberValueExact()
throws java.io.IOException
getNumberValueExact in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()
getNumberType in class com.fasterxml.jackson.core.base.ParserBasepublic int getIntValue()
throws java.io.IOException
getIntValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic long getLongValue()
throws java.io.IOException
getLongValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic java.math.BigInteger getBigIntegerValue()
throws java.io.IOException
getBigIntegerValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic float getFloatValue()
throws java.io.IOException
getFloatValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic double getDoubleValue()
throws java.io.IOException
getDoubleValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic java.math.BigDecimal getDecimalValue()
throws java.io.IOException
getDecimalValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)
throws java.io.IOException
getBinaryValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOExceptionpublic java.lang.Object getEmbeddedObject()
getEmbeddedObject in class com.fasterxml.jackson.core.JsonParserprotected void _handleEOF()
throws com.fasterxml.jackson.core.JsonParseException
_handleEOF in class com.fasterxml.jackson.core.base.ParserBasecom.fasterxml.jackson.core.JsonParseExceptionprotected boolean loadMore()
loadMore in class com.fasterxml.jackson.core.base.ParserBaseprotected void _finishString()
_finishString in class com.fasterxml.jackson.core.base.ParserBaseprotected void _closeInput()
throws java.io.IOException
_closeInput in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException