Package org.bson
Class EmptyBSONCallback
java.lang.Object
org.bson.EmptyBSONCallback
- All Implemented Interfaces:
BSONCallback
- Direct Known Subclasses:
LazyBSONCallback
Convenience implementation of BSONCallback that throws
UnsupportedOperationException for all methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalled the end of the array, and returns the completed array.voidSignals the start of a BSON array.voidarrayStart(String name) Signals the start of a BSON array, with its field name.Factory method for BSONCallbacks.get()Returns the finished top-level Document.voidCalled when reading a field with aBsonType.BINARYvalue.voidgotBoolean(String name, boolean value) Called when reading a field with aBsonType.BOOLEANvalue.voidCalled when reading a field with aBsonType.JAVASCRIPTvalue.voidgotCodeWScope(String name, String code, Object scope) Called when reading a field with aBsonType.JAVASCRIPT_WITH_SCOPEvalue.voidCalled when reading a field with aBsonType.DATE_TIMEvalue.voidInvoked whenBSONDecoderencountered aBsonType.DB_POINTERtype field in a byte sequence.voidgotDecimal128(String name, Decimal128 value) Called when reading a field with aBsonType.DECIMAL128value.voidCalled when reading a field with aBsonType.DOUBLEvalue.voidCalled when reading a field with aBsonType.INT32value.voidCalled when reading a field with aBsonType.INT64value.voidCalled when reading a field with aBsonType.MAX_KEYvalue.voidCalled when reading a field with aBsonType.MIN_KEYvalue.voidCalled when reading a BSON field that exists but has a null value.voidgotObjectId(String name, ObjectId id) Called when reading a field with aBsonType.OBJECT_IDvalue.voidCalled when reading a field with aBsonType.REGULAR_EXPRESSIONvalue.voidCalled when reading a field with aBsonType.STRINGvalue.voidCalled when reading a field with aBsonType.SYMBOLvalue.voidgotTimestamp(String name, int time, int increment) Called when reading a field with aBsonType.TIMESTAMPvalue.voidgotUndefined(String name) Called when reading a field with aBsonType.UNDEFINEDvalue.voidCalled when reading a field with aUUIDvalue.Called at the end of the document/array, and returns this object.voidSignals the start of a BSON document, which usually maps onto some Java object.voidobjectStart(String name) Signals the start of a BSON document, which usually maps onto some Java object.voidreset()Resets the callback, clearing all state.
-
Constructor Details
-
EmptyBSONCallback
public EmptyBSONCallback()
-
-
Method Details
-
objectStart
public void objectStart()Description copied from interface:BSONCallbackSignals the start of a BSON document, which usually maps onto some Java object.- Specified by:
objectStartin interfaceBSONCallback
-
objectStart
Description copied from interface:BSONCallbackSignals the start of a BSON document, which usually maps onto some Java object.- Specified by:
objectStartin interfaceBSONCallback- Parameters:
name- the field name of the document.
-
objectDone
Description copied from interface:BSONCallbackCalled at the end of the document/array, and returns this object.- Specified by:
objectDonein interfaceBSONCallback- Returns:
- the Object that has been read from this section of the document.
-
reset
public void reset()Description copied from interface:BSONCallbackResets the callback, clearing all state.- Specified by:
resetin interfaceBSONCallback
-
get
Description copied from interface:BSONCallbackReturns the finished top-level Document.- Specified by:
getin interfaceBSONCallback- Returns:
- the top level document read from the database.
-
createBSONCallback
Description copied from interface:BSONCallbackFactory method for BSONCallbacks.- Specified by:
createBSONCallbackin interfaceBSONCallback- Returns:
- a new BSONCallback.
-
arrayStart
public void arrayStart()Description copied from interface:BSONCallbackSignals the start of a BSON array.- Specified by:
arrayStartin interfaceBSONCallback
-
arrayStart
Description copied from interface:BSONCallbackSignals the start of a BSON array, with its field name.- Specified by:
arrayStartin interfaceBSONCallback- Parameters:
name- the name of this array field
-
arrayDone
Description copied from interface:BSONCallbackCalled the end of the array, and returns the completed array.- Specified by:
arrayDonein interfaceBSONCallback- Returns:
- an Object representing the array that has been read from this section of the document.
-
gotNull
Description copied from interface:BSONCallbackCalled when reading a BSON field that exists but has a null value.- Specified by:
gotNullin interfaceBSONCallback- Parameters:
name- the name of the field- See Also:
-
gotUndefined
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.UNDEFINEDvalue.- Specified by:
gotUndefinedin interfaceBSONCallback- Parameters:
name- the name of the field- See Also:
-
gotMinKey
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.MIN_KEYvalue.- Specified by:
gotMinKeyin interfaceBSONCallback- Parameters:
name- the name of the field
-
gotMaxKey
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.MAX_KEYvalue.- Specified by:
gotMaxKeyin interfaceBSONCallback- Parameters:
name- the name of the field
-
gotBoolean
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.BOOLEANvalue.- Specified by:
gotBooleanin interfaceBSONCallback- Parameters:
name- the name of the fieldvalue- the field's value
-
gotDouble
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.DOUBLEvalue.- Specified by:
gotDoublein interfaceBSONCallback- Parameters:
name- the name of the fieldvalue- the field's value
-
gotInt
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.INT32value.- Specified by:
gotIntin interfaceBSONCallback- Parameters:
name- the name of the fieldvalue- the field's value
-
gotLong
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.INT64value.- Specified by:
gotLongin interfaceBSONCallback- Parameters:
name- the name of the fieldvalue- the field's value
-
gotDecimal128
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.DECIMAL128value.- Specified by:
gotDecimal128in interfaceBSONCallback- Parameters:
name- the field namevalue- the Decimal128 field value
-
gotDate
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.DATE_TIMEvalue.- Specified by:
gotDatein interfaceBSONCallback- Parameters:
name- the name of the fieldmillis- the date and time in milliseconds
-
gotString
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.STRINGvalue.- Specified by:
gotStringin interfaceBSONCallback- Parameters:
name- the name of the fieldvalue- the field's value
-
gotSymbol
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.SYMBOLvalue.- Specified by:
gotSymbolin interfaceBSONCallback- Parameters:
name- the name of the fieldvalue- the field's value
-
gotRegex
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.REGULAR_EXPRESSIONvalue.- Specified by:
gotRegexin interfaceBSONCallback- Parameters:
name- the name of the fieldpattern- the regex patternflags- the optional flags for the regular expression
-
gotTimestamp
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.TIMESTAMPvalue.- Specified by:
gotTimestampin interfaceBSONCallback- Parameters:
name- the name of the fieldtime- the time in seconds since epochincrement- an incrementing ordinal for operations within a given second
-
gotObjectId
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.OBJECT_IDvalue.- Specified by:
gotObjectIdin interfaceBSONCallback- Parameters:
name- the name of the fieldid- the object ID
-
gotDBRef
Description copied from interface:BSONCallbackInvoked whenBSONDecoderencountered aBsonType.DB_POINTERtype field in a byte sequence.- Specified by:
gotDBRefin interfaceBSONCallback- Parameters:
name- the name of the fieldnamespace- the namespace to which reference is pointing toid- the if of the object to which reference is pointing to
-
gotBinary
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.BINARYvalue. Note that binary values have a subtype, which may determine how the value is processed.- Specified by:
gotBinaryin interfaceBSONCallback- Parameters:
name- the name of the fieldtype- one of the binary subtypes:BsonBinarySubTypedata- the field's value
-
gotUUID
Description copied from interface:BSONCallbackCalled when reading a field with aUUIDvalue. This is a binary value of subtypeBsonBinarySubType.UUID_LEGACY- Specified by:
gotUUIDin interfaceBSONCallback- Parameters:
name- the name of the fieldpart1- the first part of the UUIDpart2- the second part of the UUID
-
gotCode
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.JAVASCRIPTvalue.- Specified by:
gotCodein interfaceBSONCallback- Parameters:
name- the name of the fieldcode- the JavaScript code
-
gotCodeWScope
Description copied from interface:BSONCallbackCalled when reading a field with aBsonType.JAVASCRIPT_WITH_SCOPEvalue.- Specified by:
gotCodeWScopein interfaceBSONCallback- Parameters:
name- the name of the fieldcode- the JavaScript codescope- a document representing the scope for the code
-