org.bson
Class BSON

java.lang.Object
  extended by org.bson.BSON
Direct Known Subclasses:
Bytes

public class BSON
extends java.lang.Object


Field Summary
protected static java.nio.charset.Charset _utf8
           
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
BSON()
           
 
Method Summary
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 BSONObject decode(byte[] b)
           
static byte[] encode(BSONObject o)
           
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 int toInt(java.lang.Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

_utf8

protected static java.nio.charset.Charset _utf8
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

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)

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)