Package org.bson

Interface BSONCallback

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.Object arrayDone()
      Deprecated.
      Called the end of the array, and returns the completed array.
      void arrayStart()
      Deprecated.
      Signals the start of a BSON array.
      void arrayStart​(java.lang.String name)
      Deprecated.
      Signals the start of a BSON array, with its field name.
      BSONCallback createBSONCallback()
      Deprecated.
      Factory method for BSONCallbacks.
      java.lang.Object get()
      Deprecated.
      Returns the finished top-level Document.
      void gotBinary​(java.lang.String name, byte type, byte[] data)
      Deprecated.
      Called when reading a field with a BsonType.BINARY value.
      void gotBinaryArray​(java.lang.String name, byte[] data)
      Deprecated.
      this method is no longer called by the decoder
      void gotBoolean​(java.lang.String name, boolean value)
      Deprecated.
      Called when reading a field with a BsonType.BOOLEAN value.
      void gotCode​(java.lang.String name, java.lang.String code)
      Deprecated.
      Called when reading a field with a BsonType.JAVASCRIPT value.
      void gotCodeWScope​(java.lang.String name, java.lang.String code, java.lang.Object scope)
      Deprecated.
      Called when reading a field with a BsonType.JAVASCRIPT_WITH_SCOPE value.
      void gotDate​(java.lang.String name, long millis)
      Deprecated.
      Called when reading a field with a BsonType.DATE_TIME value.
      void gotDBRef​(java.lang.String name, java.lang.String namespace, ObjectId id)
      Deprecated.
      Invoked when BSONDecoder encountered a BsonType.DB_POINTER type field in a byte sequence.
      void gotDecimal128​(java.lang.String name, Decimal128 value)
      Deprecated.
      Called when reading a field with a BsonType.DECIMAL128 value.
      void gotDouble​(java.lang.String name, double value)
      Deprecated.
      Called when reading a field with a BsonType.DOUBLE value.
      void gotInt​(java.lang.String name, int value)
      Deprecated.
      Called when reading a field with a BsonType.INT32 value.
      void gotLong​(java.lang.String name, long value)
      Deprecated.
      Called when reading a field with a BsonType.INT64 value.
      void gotMaxKey​(java.lang.String name)
      Deprecated.
      Called when reading a field with a BsonType.MAX_KEY value.
      void gotMinKey​(java.lang.String name)
      Deprecated.
      Called when reading a field with a BsonType.MIN_KEY value.
      void gotNull​(java.lang.String name)
      Deprecated.
      Called when reading a BSON field that exists but has a null value.
      void gotObjectId​(java.lang.String name, ObjectId id)
      Deprecated.
      Called when reading a field with a BsonType.OBJECT_ID value.
      void gotRegex​(java.lang.String name, java.lang.String pattern, java.lang.String flags)
      Deprecated.
      Called when reading a field with a BsonType.REGULAR_EXPRESSION value.
      void gotString​(java.lang.String name, java.lang.String value)
      Deprecated.
      Called when reading a field with a BsonType.STRING value.
      void gotSymbol​(java.lang.String name, java.lang.String value)
      Deprecated.
      Called when reading a field with a BsonType.SYMBOL value.
      void gotTimestamp​(java.lang.String name, int time, int increment)
      Deprecated.
      Called when reading a field with a BsonType.TIMESTAMP value.
      void gotUndefined​(java.lang.String name)
      Deprecated.
      Called when reading a field with a BsonType.UNDEFINED value.
      void gotUUID​(java.lang.String name, long part1, long part2)
      Deprecated.
      Called when reading a field with a UUID value.
      java.lang.Object objectDone()
      Deprecated.
      Called at the end of the document/array, and returns this object.
      void objectStart()
      Deprecated.
      Signals the start of a BSON document, which usually maps onto some Java object.
      void objectStart​(java.lang.String name)
      Deprecated.
      Signals the start of a BSON document, which usually maps onto some Java object.
      void reset()
      Deprecated.
      Resets the callback, clearing all state.
    • Method Detail

      • objectStart

        void objectStart()
        Deprecated.
        Signals the start of a BSON document, which usually maps onto some Java object.
      • objectStart

        void objectStart​(java.lang.String name)
        Deprecated.
        Signals the start of a BSON document, which usually maps onto some Java object.
        Parameters:
        name - the field name of the document.
      • objectDone

        java.lang.Object objectDone()
        Deprecated.
        Called at the end of the document/array, and returns this object.
        Returns:
        the Object that has been read from this section of the document.
      • reset

        void reset()
        Deprecated.
        Resets the callback, clearing all state.
      • get

        java.lang.Object get()
        Deprecated.
        Returns the finished top-level Document.
        Returns:
        the top level document read from the database.
      • createBSONCallback

        BSONCallback createBSONCallback()
        Deprecated.
        Factory method for BSONCallbacks.
        Returns:
        a new BSONCallback.
      • arrayStart

        void arrayStart()
        Deprecated.
        Signals the start of a BSON array.
      • arrayStart

        void arrayStart​(java.lang.String name)
        Deprecated.
        Signals the start of a BSON array, with its field name.
        Parameters:
        name - the name of this array field
      • arrayDone

        java.lang.Object arrayDone()
        Deprecated.
        Called the end of the array, and returns the completed array.
        Returns:
        an Object representing the array that has been read from this section of the document.
      • gotNull

        void gotNull​(java.lang.String name)
        Deprecated.
        Called when reading a BSON field that exists but has a null value.
        Parameters:
        name - the name of the field
        See Also:
        BsonType.NULL
      • gotUndefined

        void gotUndefined​(java.lang.String name)
        Deprecated.
        Called when reading a field with a BsonType.UNDEFINED value.
        Parameters:
        name - the name of the field
        See Also:
        BsonType.UNDEFINED
      • gotMinKey

        void gotMinKey​(java.lang.String name)
        Deprecated.
        Called when reading a field with a BsonType.MIN_KEY value.
        Parameters:
        name - the name of the field
      • gotMaxKey

        void gotMaxKey​(java.lang.String name)
        Deprecated.
        Called when reading a field with a BsonType.MAX_KEY value.
        Parameters:
        name - the name of the field
      • gotBoolean

        void gotBoolean​(java.lang.String name,
                        boolean value)
        Deprecated.
        Called when reading a field with a BsonType.BOOLEAN value.
        Parameters:
        name - the name of the field
        value - the field's value
      • gotDouble

        void gotDouble​(java.lang.String name,
                       double value)
        Deprecated.
        Called when reading a field with a BsonType.DOUBLE value.
        Parameters:
        name - the name of the field
        value - the field's value
      • gotDecimal128

        void gotDecimal128​(java.lang.String name,
                           Decimal128 value)
        Deprecated.
        Called when reading a field with a BsonType.DECIMAL128 value.
        Parameters:
        name - the field name
        value - the Decimal128 field value
        Since:
        3.4
      • gotInt

        void gotInt​(java.lang.String name,
                    int value)
        Deprecated.
        Called when reading a field with a BsonType.INT32 value.
        Parameters:
        name - the name of the field
        value - the field's value
      • gotLong

        void gotLong​(java.lang.String name,
                     long value)
        Deprecated.
        Called when reading a field with a BsonType.INT64 value.
        Parameters:
        name - the name of the field
        value - the field's value
      • gotDate

        void gotDate​(java.lang.String name,
                     long millis)
        Deprecated.
        Called when reading a field with a BsonType.DATE_TIME value.
        Parameters:
        name - the name of the field
        millis - the date and time in milliseconds
      • gotString

        void gotString​(java.lang.String name,
                       java.lang.String value)
        Deprecated.
        Called when reading a field with a BsonType.STRING value.
        Parameters:
        name - the name of the field
        value - the field's value
      • gotSymbol

        void gotSymbol​(java.lang.String name,
                       java.lang.String value)
        Deprecated.
        Called when reading a field with a BsonType.SYMBOL value.
        Parameters:
        name - the name of the field
        value - the field's value
      • gotRegex

        void gotRegex​(java.lang.String name,
                      java.lang.String pattern,
                      java.lang.String flags)
        Deprecated.
        Called when reading a field with a BsonType.REGULAR_EXPRESSION value.
        Parameters:
        name - the name of the field
        pattern - the regex pattern
        flags - the optional flags for the regular expression
      • gotTimestamp

        void gotTimestamp​(java.lang.String name,
                          int time,
                          int increment)
        Deprecated.
        Called when reading a field with a BsonType.TIMESTAMP value.
        Parameters:
        name - the name of the field
        time - the time in seconds since epoch
        increment - an incrementing ordinal for operations within a given second
      • gotObjectId

        void gotObjectId​(java.lang.String name,
                         ObjectId id)
        Deprecated.
        Called when reading a field with a BsonType.OBJECT_ID value.
        Parameters:
        name - the name of the field
        id - the object ID
      • gotDBRef

        void gotDBRef​(java.lang.String name,
                      java.lang.String namespace,
                      ObjectId id)
        Deprecated.
        Invoked when BSONDecoder encountered a BsonType.DB_POINTER type field in a byte sequence.
        Parameters:
        name - the name of the field
        namespace - the namespace to which reference is pointing to
        id - the if of the object to which reference is pointing to
      • gotBinaryArray

        @Deprecated
        void gotBinaryArray​(java.lang.String name,
                            byte[] data)
        Deprecated.
        this method is no longer called by the decoder
        This method is not used.
        Parameters:
        name - the name of the field
        data - the field's value
      • gotBinary

        void gotBinary​(java.lang.String name,
                       byte type,
                       byte[] data)
        Deprecated.
        Called when reading a field with a BsonType.BINARY value. Note that binary values have a subtype, which may determine how the value is processed.
        Parameters:
        name - the name of the field
        type - one of the binary subtypes: BsonBinarySubType
        data - the field's value
      • gotUUID

        void gotUUID​(java.lang.String name,
                     long part1,
                     long part2)
        Deprecated.
        Called when reading a field with a UUID value. This is a binary value of subtype BsonBinarySubType.UUID_LEGACY
        Parameters:
        name - the name of the field
        part1 - the first part of the UUID
        part2 - the second part of the UUID
      • gotCode

        void gotCode​(java.lang.String name,
                     java.lang.String code)
        Deprecated.
        Called when reading a field with a BsonType.JAVASCRIPT value.
        Parameters:
        name - the name of the field
        code - the JavaScript code
      • gotCodeWScope

        void gotCodeWScope​(java.lang.String name,
                           java.lang.String code,
                           java.lang.Object scope)
        Deprecated.
        Called when reading a field with a BsonType.JAVASCRIPT_WITH_SCOPE value.
        Parameters:
        name - the name of the field
        code - the JavaScript code
        scope - a document representing the scope for the code