|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.fasterxml.jackson.core.JsonParser
com.fasterxml.jackson.core.base.ParserMinimalBase
com.fasterxml.jackson.core.base.ParserBase
de.undercouch.bson4jackson.BsonParser
public class BsonParser
Reads a BSON document from the provided input stream
| Nested Class Summary | |
|---|---|
static class |
BsonParser.Feature
Defines toggable features |
| Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser |
|---|
com.fasterxml.jackson.core.JsonParser.NumberType |
| Field Summary |
|---|
| Fields inherited from class com.fasterxml.jackson.core.base.ParserBase |
|---|
_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, CHAR_NULL, INT_0, INT_1, INT_2, INT_3, INT_4, INT_5, INT_6, INT_7, INT_8, INT_9, INT_DECIMAL_POINT, INT_e, INT_E, INT_MINUS, INT_PLUS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_INT, NR_LONG, NR_UNKNOWN |
| Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase |
|---|
_currToken, _lastClearedToken, INT_APOSTROPHE, INT_ASTERISK, INT_b, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_f, INT_LBRACKET, INT_LCURLY, INT_LF, INT_n, INT_QUOTE, INT_r, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_t, INT_TAB, INT_u |
| Fields inherited from class com.fasterxml.jackson.core.JsonParser |
|---|
_features |
| Constructor Summary | |
|---|---|
BsonParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int jsonFeatures,
int bsonFeatures,
java.io.InputStream in)
Constructs a new parser |
|
| Method Summary | |
|---|---|
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 de.undercouch.bson4jackson.BsonParser.Context |
getContext()
|
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()
|
com.fasterxml.jackson.core.json.JsonReadContext |
getParsingContext()
|
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 |
| Methods inherited from class com.fasterxml.jackson.core.base.ParserBase |
|---|
_decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _getByteArrayBuilder, _parseNumericValue, _releaseBuffers, _reportMismatchedEndMarker, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToInt, convertNumberToLong, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, loadMoreGuaranteed, overrideCurrentName, reportInvalidBase64Char, reportInvalidBase64Char, reportInvalidNumber, reportOverflowInt, reportOverflowLong, reportUnexpectedNumberChar, reset, resetAsNaN, resetFloat, resetInt, version |
| Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase |
|---|
_constructError, _decodeBase64, _getCharDesc, _handleUnrecognizedCharacterEscape, _reportBase64EOF, _reportError, _reportInvalidBase64, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _throwUnquotedSpace, _wrapError, clearCurrentToken, getCurrentToken, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, getValueAsString, hasCurrentToken, nextValue, skipChildren |
| Methods inherited from class com.fasterxml.jackson.core.JsonParser |
|---|
_constructError, _reportUnsupportedOperation, canUseSchema, configure, disable, enable, getBinaryValue, getBooleanValue, getByteValue, getInputSource, getSchema, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, getValueAsString, isEnabled, nextBooleanValue, nextFieldName, nextIntValue, nextLongValue, nextTextValue, readBinaryValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, requiresCustomCodec, setSchema |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
protected boolean isEnabled(BsonParser.Feature f)
f - the feature
public boolean isExpectedStartArrayToken()
isExpectedStartArrayToken in class com.fasterxml.jackson.core.JsonParserpublic 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.JsonParser
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
public com.fasterxml.jackson.core.JsonToken nextToken()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
nextToken in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
protected com.fasterxml.jackson.core.JsonToken handleNewDocument(boolean array)
throws java.io.IOException
array - true if the document is an embedded array
java.io.IOException - if an I/O error occurs
protected com.fasterxml.jackson.core.JsonToken handleBinary()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected int regexStrToFlags(java.lang.String pattern)
throws com.fasterxml.jackson.core.JsonParseException
Pattern.compile(String, int)
pattern - the regex pattern string
com.fasterxml.jackson.core.JsonParseException - if the pattern string contains a unsupported flag
protected com.fasterxml.jackson.core.JsonToken handleRegEx()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected com.fasterxml.jackson.core.JsonToken handleDBPointer()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected com.fasterxml.jackson.core.JsonToken handleJavascriptWithScope()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected java.lang.String readCString()
throws java.io.IOException
java.io.IOException - if the string could not be read
protected void skipCString()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected java.lang.String readString()
throws java.io.IOException
java.io.IOException - if the string could not be read
protected Symbol readSymbol()
throws java.io.IOException
java.io.IOException - if the symbol could not be read
protected Timestamp readTimestamp()
throws java.io.IOException
java.io.IOException - if the timestamp could not be read
protected ObjectId readObjectId()
throws java.io.IOException
java.io.IOException - if the ObjectID could not be read
protected java.util.Map<java.lang.String,java.lang.Object> readDocument()
throws java.io.IOException
java.io.IOException - if the document could not be read
protected de.undercouch.bson4jackson.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.ParserBase
public java.lang.String getCurrentName()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getCurrentName in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseExceptionpublic com.fasterxml.jackson.core.json.JsonReadContext getParsingContext()
getParsingContext in class com.fasterxml.jackson.core.base.ParserBasepublic 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.ParserBase
public java.lang.String getText()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getText in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public char[] getTextCharacters()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getTextCharacters in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public int getTextLength()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getTextLength in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public int getTextOffset()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getTextOffset in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseExceptionpublic boolean hasTextCharacters()
hasTextCharacters in class com.fasterxml.jackson.core.base.ParserBase
public java.lang.Number getNumberValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getNumberValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getNumberType in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public int getIntValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getIntValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public long getLongValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getLongValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public java.math.BigInteger getBigIntegerValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getBigIntegerValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public float getFloatValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getFloatValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public double getDoubleValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getDoubleValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public java.math.BigDecimal getDecimalValue()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getDecimalValue in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getBinaryValue in class com.fasterxml.jackson.core.base.ParserMinimalBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
public java.lang.Object getEmbeddedObject()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
getEmbeddedObject in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
protected void _handleEOF()
throws com.fasterxml.jackson.core.JsonParseException
_handleEOF in class com.fasterxml.jackson.core.base.ParserBasecom.fasterxml.jackson.core.JsonParseException
protected boolean loadMore()
throws java.io.IOException
loadMore in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
protected void _finishString()
throws java.io.IOException,
com.fasterxml.jackson.core.JsonParseException
_finishString in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
com.fasterxml.jackson.core.JsonParseException
protected void _closeInput()
throws java.io.IOException
_closeInput in class com.fasterxml.jackson.core.base.ParserBasejava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||