|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.jackson.JsonParser
org.codehaus.jackson.impl.JsonParserMinimalBase
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 org.codehaus.jackson.JsonParser |
|---|
org.codehaus.jackson.JsonParser.NumberType |
| Field Summary |
|---|
| Fields inherited from class org.codehaus.jackson.impl.JsonParserMinimalBase |
|---|
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 org.codehaus.jackson.JsonParser |
|---|
_currToken, _features, _lastClearedToken |
| Constructor Summary | |
|---|---|
BsonParser(int jsonFeatures,
int bsonFeatures,
java.io.InputStream in)
Constructs a new parser |
|
| Method Summary | |
|---|---|
protected void |
_handleEOF()
|
void |
close()
|
java.math.BigInteger |
getBigIntegerValue()
|
byte[] |
getBinaryValue(org.codehaus.jackson.Base64Variant b64variant)
|
org.codehaus.jackson.ObjectCodec |
getCodec()
|
protected de.undercouch.bson4jackson.BsonParser.Context |
getContext()
|
org.codehaus.jackson.JsonLocation |
getCurrentLocation()
|
java.lang.String |
getCurrentName()
|
java.math.BigDecimal |
getDecimalValue()
|
double |
getDoubleValue()
|
java.lang.Object |
getEmbeddedObject()
|
float |
getFloatValue()
|
int |
getIntValue()
|
long |
getLongValue()
|
org.codehaus.jackson.JsonParser.NumberType |
getNumberType()
|
java.lang.Number |
getNumberValue()
|
org.codehaus.jackson.JsonStreamContext |
getParsingContext()
|
java.lang.String |
getText()
|
char[] |
getTextCharacters()
|
int |
getTextLength()
|
int |
getTextOffset()
|
org.codehaus.jackson.JsonLocation |
getTokenLocation()
|
protected org.codehaus.jackson.JsonToken |
handleBinary()
Reads binary data from the input stream |
protected org.codehaus.jackson.JsonToken |
handleDBPointer()
Reads a DBPointer from the stream |
protected org.codehaus.jackson.JsonToken |
handleJavascriptWithScope()
Can be called when embedded javascript code with scope is found. |
protected org.codehaus.jackson.JsonToken |
handleNewDocument(boolean array)
Can be called when a new embedded document is found. |
protected org.codehaus.jackson.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 |
org.codehaus.jackson.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(org.codehaus.jackson.ObjectCodec c)
|
protected void |
skipCString()
Skips over a null-terminated string in the input stream |
| Methods inherited from class org.codehaus.jackson.impl.JsonParserMinimalBase |
|---|
_constructError, _getCharDesc, _handleUnrecognizedCharacterEscape, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _throwUnquotedSpace, _wrapError, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, skipChildren |
| Methods inherited from class org.codehaus.jackson.JsonParser |
|---|
_constructError, clearCurrentToken, configure, disable, disableFeature, enable, enableFeature, getBinaryValue, getBooleanValue, getByteValue, getCurrentToken, getLastClearedToken, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, hasCurrentToken, isEnabled, isExpectedStartArrayToken, isFeatureEnabled, nextValue, readValueAs, readValueAs, readValueAsTree, releaseBuffered, releaseBuffered, setFeature, version |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BsonParser(int jsonFeatures,
int bsonFeatures,
java.io.InputStream in)
jsonFeatures - 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 org.codehaus.jackson.ObjectCodec getCodec()
getCodec in class org.codehaus.jackson.JsonParserpublic void setCodec(org.codehaus.jackson.ObjectCodec c)
setCodec in class org.codehaus.jackson.JsonParser
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
public org.codehaus.jackson.JsonToken nextToken()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
nextToken in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseException
protected org.codehaus.jackson.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 org.codehaus.jackson.JsonToken handleBinary()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected int regexStrToFlags(java.lang.String pattern)
throws org.codehaus.jackson.JsonParseException
Pattern.compile(String, int)
pattern - the regex pattern string
org.codehaus.jackson.JsonParseException - if the pattern string contains a unsupported flag
protected org.codehaus.jackson.JsonToken handleRegEx()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected org.codehaus.jackson.JsonToken handleDBPointer()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
protected org.codehaus.jackson.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 org.codehaus.jackson.impl.JsonParserMinimalBase
public java.lang.String getCurrentName()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getCurrentName in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseExceptionpublic org.codehaus.jackson.JsonStreamContext getParsingContext()
getParsingContext in class org.codehaus.jackson.impl.JsonParserMinimalBasepublic org.codehaus.jackson.JsonLocation getTokenLocation()
getTokenLocation in class org.codehaus.jackson.JsonParserpublic org.codehaus.jackson.JsonLocation getCurrentLocation()
getCurrentLocation in class org.codehaus.jackson.JsonParser
public java.lang.String getText()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getText in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseException
public char[] getTextCharacters()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getTextCharacters in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseException
public int getTextLength()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getTextLength in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseException
public int getTextOffset()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getTextOffset in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseExceptionpublic boolean hasTextCharacters()
hasTextCharacters in class org.codehaus.jackson.impl.JsonParserMinimalBase
public java.lang.Number getNumberValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getNumberValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public org.codehaus.jackson.JsonParser.NumberType getNumberType()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getNumberType in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public int getIntValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getIntValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public long getLongValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getLongValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public java.math.BigInteger getBigIntegerValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getBigIntegerValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public float getFloatValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getFloatValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public double getDoubleValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getDoubleValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public java.math.BigDecimal getDecimalValue()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getDecimalValue in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
public byte[] getBinaryValue(org.codehaus.jackson.Base64Variant b64variant)
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getBinaryValue in class org.codehaus.jackson.impl.JsonParserMinimalBasejava.io.IOException
org.codehaus.jackson.JsonParseException
public java.lang.Object getEmbeddedObject()
throws java.io.IOException,
org.codehaus.jackson.JsonParseException
getEmbeddedObject in class org.codehaus.jackson.JsonParserjava.io.IOException
org.codehaus.jackson.JsonParseException
protected void _handleEOF()
throws org.codehaus.jackson.JsonParseException
_handleEOF in class org.codehaus.jackson.impl.JsonParserMinimalBaseorg.codehaus.jackson.JsonParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||