public class

BSON

extends Object
java.lang.Object
   ↳ org.bson.BSON
Known Direct Subclasses

Summary

Constants
byte ARRAY
byte BINARY
byte BOOLEAN
byte B_BINARY
byte B_FUNC
byte B_GENERAL
byte B_UUID
byte CODE
byte CODE_W_SCOPE
byte DATE
byte EOO
byte MAXKEY
byte MINKEY
byte NULL
byte NUMBER
byte NUMBER_INT
byte NUMBER_LONG
byte OBJECT
byte OID
byte REF
byte REGEX
byte STRING
byte SYMBOL
byte TIMESTAMP
byte UNDEFINED
Fields
protected static Charset _utf8
Public Constructors
BSON()
Public Methods
static void addDecodingHook(Class c, Transformer t)
static void addEncodingHook(Class c, Transformer t)
static Object applyDecodingHooks(Object o)
static Object applyEncodingHooks(Object o)
static void clearAllHooks()
static void clearDecodingHooks()
Clears *all* decoding hooks.
static void clearEncodingHooks()
Clears *all* encoding hooks.
static BSONObject decode(byte[] b)
static byte[] encode(BSONObject o)
static List<Transformer> getDecodingHooks(Class c)
Returns the decoding hook(s) associated with the specific class
static List<Transformer> getEncodingHooks(Class c)
Returns the encoding hook(s) associated with the specified class
static boolean hasDecodeHooks()
static int regexFlag(char c)
static int regexFlags(String flags)
Converts a string of regular expression flags from the database in Java regular expression flags.
static String regexFlags(int flags)
Converts Java regular expression flags into a string of flags for the database
static void removeDecodingHook(Class c, Transformer t)
Remove a specific encoding hook for a specific class.
static void removeDecodingHooks(Class c)
Remove all decoding hooks for a specific class.
static void removeEncodingHook(Class c, Transformer t)
Remove a specific encoding hook for a specific class.
static void removeEncodingHooks(Class c)
Remove all encoding hooks for a specific class.
static int toInt(Object o)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final byte ARRAY

Constant Value: 4 (0x00000004)

public static final byte BINARY

Constant Value: 5 (0x00000005)

public static final byte BOOLEAN

Constant Value: 8 (0x00000008)

public static final byte B_BINARY

Constant Value: 2 (0x00000002)

public static final byte B_FUNC

Constant Value: 1 (0x00000001)

public static final byte B_GENERAL

Constant Value: 0 (0x00000000)

public static final byte B_UUID

Constant Value: 3 (0x00000003)

public static final byte CODE

Constant Value: 13 (0x0000000d)

public static final byte CODE_W_SCOPE

Constant Value: 15 (0x0000000f)

public static final byte DATE

Constant Value: 9 (0x00000009)

public static final byte EOO

Constant Value: 0 (0x00000000)

public static final byte MAXKEY

Constant Value: 127 (0x0000007f)

public static final byte MINKEY

Constant Value: -1 (0xffffffff)

public static final byte NULL

Constant Value: 10 (0x0000000a)

public static final byte NUMBER

Constant Value: 1 (0x00000001)

public static final byte NUMBER_INT

Constant Value: 16 (0x00000010)

public static final byte NUMBER_LONG

Constant Value: 18 (0x00000012)

public static final byte OBJECT

Constant Value: 3 (0x00000003)

public static final byte OID

Constant Value: 7 (0x00000007)

public static final byte REF

Constant Value: 12 (0x0000000c)

public static final byte REGEX

Constant Value: 11 (0x0000000b)

public static final byte STRING

Constant Value: 2 (0x00000002)

public static final byte SYMBOL

Constant Value: 14 (0x0000000e)

public static final byte TIMESTAMP

Constant Value: 17 (0x00000011)

public static final byte UNDEFINED

Constant Value: 6 (0x00000006)

Fields

protected static Charset _utf8

Public Constructors

public BSON ()

Public Methods

public static void addDecodingHook (Class c, Transformer t)

public static void addEncodingHook (Class c, Transformer t)

public static Object applyDecodingHooks (Object o)

public static Object applyEncodingHooks (Object o)

public static void clearAllHooks ()

public static void clearDecodingHooks ()

Clears *all* decoding hooks.

public static void clearEncodingHooks ()

Clears *all* encoding hooks.

public static BSONObject decode (byte[] b)

public static byte[] encode (BSONObject o)

public static List<Transformer> getDecodingHooks (Class c)

Returns the decoding hook(s) associated with the specific class

public static List<Transformer> getEncodingHooks (Class c)

Returns the encoding hook(s) associated with the specified class

public static boolean hasDecodeHooks ()

public static int regexFlag (char c)

public static int regexFlags (String flags)

Converts a string of regular expression flags from the database in Java regular expression flags.

Parameters
flags flags from database
Returns
  • the Java flags

public static String regexFlags (int flags)

Converts Java regular expression flags into a string of flags for the database

Parameters
flags Java flags
Returns
  • the flags for the database

public static void removeDecodingHook (Class c, Transformer t)

Remove a specific encoding hook for a specific class.

public static void removeDecodingHooks (Class c)

Remove all decoding hooks for a specific class.

public static void removeEncodingHook (Class c, Transformer t)

Remove a specific encoding hook for a specific class.

public static void removeEncodingHooks (Class c)

Remove all encoding hooks for a specific class.

public static int toInt (Object o)