BSON
Date: 2015-03-03

org.bson

## Class BSON

- java.lang.Object
- - org.bson.BSON

-     public class BSON
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `ARRAY`
    `static byte` | `B_BINARY`
    `static byte` | `B_FUNC`
    `static byte` | `B_GENERAL`
    `static byte` | `B_UUID`
    `static byte` | `BINARY`
    `static byte` | `BOOLEAN`
    `static byte` | `CODE`
    `static byte` | `CODE_W_SCOPE`
    `static byte` | `DATE`
    `static byte` | `EOO`
    `static byte` | `MAXKEY`
    `static byte` | `MINKEY`
    `static byte` | `NULL`
    `static byte` | `NUMBER`
    `static byte` | `NUMBER_INT`
    `static byte` | `NUMBER_LONG`
    `static byte` | `OBJECT`
    `static byte` | `OID`
    `static byte` | `REF`
    `static byte` | `REGEX`
    `static byte` | `STRING`
    `static byte` | `SYMBOL`
    `static byte` | `TIMESTAMP`
    `static byte` | `UNDEFINED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BSON()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addDecodingHook(java.lang.Class<?> c, Transformer t)`
    `static void` | `addEncodingHook(java.lang.Class<?> c, Transformer t)`
    `static java.lang.Object` | `applyDecodingHooks(java.lang.Object o)`
    `static java.lang.Object` | `applyEncodingHooks(java.lang.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 java.util.List<Transformer>` | `getDecodingHooks(java.lang.Class<?> c)` Returns the decoding hook(s) associated with the specific class
    `static java.util.List<Transformer>` | `getEncodingHooks(java.lang.Class<?> c)` Returns the encoding hook(s) associated with the specified class
    `static boolean` | `hasDecodeHooks()`
    `static int` | `regexFlag(char c)`
    `static java.lang.String` | `regexFlags(int flags)` Converts Java regular expression flags into a string of flags for the database
    `static int` | `regexFlags(java.lang.String flags)` Converts a string of regular expression flags from the database in Java regular expression flags.
    `static void` | `removeDecodingHook(java.lang.Class<?> c, Transformer t)` Remove a specific encoding hook for a specific class.
    `static void` | `removeDecodingHooks(java.lang.Class<?> c)` Remove all decoding hooks for a specific class.
    `static void` | `removeEncodingHook(java.lang.Class<?> c, Transformer t)` Remove a specific encoding hook for a specific class.
    `static void` | `removeEncodingHooks(java.lang.Class<?> c)` Remove all encoding hooks for a specific class.
    `static int` | `toInt(java.lang.Object o)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EOO

          public static final byte EOO

      See Also:
        Constant Field Values

    - #### NUMBER

          public static final byte NUMBER

      See Also:
        Constant Field Values

    - #### STRING

          public static final byte STRING

      See Also:
        Constant Field Values

    - #### OBJECT

          public static final byte OBJECT

      See Also:
        Constant Field Values

    - #### ARRAY

          public static final byte ARRAY

      See Also:
        Constant Field Values

    - #### BINARY

          public static final byte BINARY

      See Also:
        Constant Field Values

    - #### UNDEFINED

          public static final byte UNDEFINED

      See Also:
        Constant Field Values

    - #### OID

          public static final byte OID

      See Also:
        Constant Field Values

    - #### BOOLEAN

          public static final byte BOOLEAN

      See Also:
        Constant Field Values

    - #### DATE

          public static final byte DATE

      See Also:
        Constant Field Values

    - #### NULL

          public static final byte NULL

      See Also:
        Constant Field Values

    - #### REGEX

          public static final byte REGEX

      See Also:
        Constant Field Values

    - #### REF

          public static final byte REF

      See Also:
        Constant Field Values

    - #### CODE

          public static final byte CODE

      See Also:
        Constant Field Values

    - #### SYMBOL

          public static final byte SYMBOL

      See Also:
        Constant Field Values

    - #### CODE_W_SCOPE

          public static final byte CODE_W_SCOPE

      See Also:
        Constant Field Values

    - #### NUMBER_INT

          public static final byte NUMBER_INT

      See Also:
        Constant Field Values

    - #### TIMESTAMP

          public static final byte TIMESTAMP

      See Also:
        Constant Field Values

    - #### NUMBER_LONG

          public static final byte NUMBER_LONG

      See Also:
        Constant Field Values

    - #### MINKEY

          public static final byte MINKEY

      See Also:
        Constant Field Values

    - #### MAXKEY

          public static final byte MAXKEY

      See Also:
        Constant Field Values

    - #### B_GENERAL

          public static final byte B_GENERAL

      See Also:
        Constant Field Values

    - #### B_FUNC

          public static final byte B_FUNC

      See Also:
        Constant Field Values

    - #### B_BINARY

          public static final byte B_BINARY

      See Also:
        Constant Field Values

    - #### B_UUID

          public static final byte B_UUID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### BSON

          public BSON()

  - ### Method Detail

    - #### regexFlags

          public static int regexFlags(java.lang.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

    - #### regexFlag

          public static int regexFlag(char c)

    - #### regexFlags

          public static java.lang.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

    - #### hasDecodeHooks

          public static boolean hasDecodeHooks()

    - #### addEncodingHook

          public static void addEncodingHook(java.lang.Class<?> c,
                             Transformer t)

    - #### addDecodingHook

          public static void addDecodingHook(java.lang.Class<?> c,
                             Transformer t)

    - #### applyEncodingHooks

          public static java.lang.Object applyEncodingHooks(java.lang.Object o)

    - #### applyDecodingHooks

          public static java.lang.Object applyDecodingHooks(java.lang.Object o)

    - #### getEncodingHooks

          public static java.util.List<Transformer> getEncodingHooks(java.lang.Class<?> c)

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

    - #### clearEncodingHooks

          public static void clearEncodingHooks()

      Clears *all* encoding hooks.

    - #### removeEncodingHooks

          public static void removeEncodingHooks(java.lang.Class<?> c)

      Remove all encoding hooks for a specific class.

    - #### removeEncodingHook

          public static void removeEncodingHook(java.lang.Class<?> c,
                                Transformer t)

      Remove a specific encoding hook for a specific class.

    - #### getDecodingHooks

          public static java.util.List<Transformer> getDecodingHooks(java.lang.Class<?> c)

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

    - #### clearDecodingHooks

          public static void clearDecodingHooks()

      Clears *all* decoding hooks.

    - #### removeDecodingHooks

          public static void removeDecodingHooks(java.lang.Class<?> c)

      Remove all decoding hooks for a specific class.

    - #### removeDecodingHook

          public static void removeDecodingHook(java.lang.Class<?> c,
                                Transformer t)

      Remove a specific encoding hook for a specific class.

    - #### clearAllHooks

          public static void clearAllHooks()

    - #### encode

          public static byte[] encode(BSONObject o)

    - #### decode

          public static BSONObject decode(byte[] b)

    - #### toInt

          public static int toInt(java.lang.Object o)