org.bson
Class BasicBSONCallback

java.lang.Object
  extended by org.bson.BasicBSONCallback
All Implemented Interfaces:
BSONCallback
Direct Known Subclasses:
DefaultDBCallback, JSONCallback

public class BasicBSONCallback
extends Object
implements BSONCallback


Constructor Summary
BasicBSONCallback()
           
 
Method Summary
protected  void _put(String name, Object o)
           
 Object arrayDone()
           
 void arrayStart()
           
 void arrayStart(String name)
           
 BSONObject create()
           
 BSONObject create(boolean array, List<String> path)
           
 BSONCallback createBSONCallback()
           
protected  BSONObject createList()
           
protected  BSONObject cur()
           
protected  String curName()
           
 Object get()
           
 void gotBinary(String name, byte type, byte[] data)
           
 void gotBinaryArray(String name, byte[] data)
          Deprecated. 
 void gotBoolean(String name, boolean v)
           
 void gotCode(String name, String code)
           
 void gotCodeWScope(String name, String code, Object scope)
           
 void gotDate(String name, long millis)
           
 void gotDBRef(String name, String ns, ObjectId id)
           
 void gotDouble(String name, double v)
           
 void gotInt(String name, int v)
           
 void gotLong(String name, long v)
           
 void gotMaxKey(String name)
           
 void gotMinKey(String name)
           
 void gotNull(String name)
           
 void gotObjectId(String name, ObjectId id)
           
 void gotRegex(String name, String pattern, String flags)
           
 void gotString(String name, String v)
           
 void gotSymbol(String name, String v)
           
 void gotTimestamp(String name, int time, int inc)
           
 void gotUndefined(String name)
           
 void gotUUID(String name, long part1, long part2)
          subtype 3
protected  boolean isStackEmpty()
           
 Object objectDone()
           
 void objectStart()
           
 void objectStart(boolean array)
           
 void objectStart(boolean array, String name)
           
 void objectStart(String name)
           
 void reset()
           
protected  void setRoot(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicBSONCallback

public BasicBSONCallback()
Method Detail

create

public BSONObject create()

createList

protected BSONObject createList()

createBSONCallback

public BSONCallback createBSONCallback()
Specified by:
createBSONCallback in interface BSONCallback

create

public BSONObject create(boolean array,
                         List<String> path)

objectStart

public void objectStart()
Specified by:
objectStart in interface BSONCallback

objectStart

public void objectStart(boolean array)
Specified by:
objectStart in interface BSONCallback

objectStart

public void objectStart(String name)
Specified by:
objectStart in interface BSONCallback

objectStart

public void objectStart(boolean array,
                        String name)

objectDone

public Object objectDone()
Specified by:
objectDone in interface BSONCallback

arrayStart

public void arrayStart()
Specified by:
arrayStart in interface BSONCallback

arrayStart

public void arrayStart(String name)
Specified by:
arrayStart in interface BSONCallback

arrayDone

public Object arrayDone()
Specified by:
arrayDone in interface BSONCallback

gotNull

public void gotNull(String name)
Specified by:
gotNull in interface BSONCallback

gotUndefined

public void gotUndefined(String name)
Specified by:
gotUndefined in interface BSONCallback

gotMinKey

public void gotMinKey(String name)
Specified by:
gotMinKey in interface BSONCallback

gotMaxKey

public void gotMaxKey(String name)
Specified by:
gotMaxKey in interface BSONCallback

gotBoolean

public void gotBoolean(String name,
                       boolean v)
Specified by:
gotBoolean in interface BSONCallback

gotDouble

public void gotDouble(String name,
                      double v)
Specified by:
gotDouble in interface BSONCallback

gotInt

public void gotInt(String name,
                   int v)
Specified by:
gotInt in interface BSONCallback

gotLong

public void gotLong(String name,
                    long v)
Specified by:
gotLong in interface BSONCallback

gotDate

public void gotDate(String name,
                    long millis)
Specified by:
gotDate in interface BSONCallback

gotRegex

public void gotRegex(String name,
                     String pattern,
                     String flags)
Specified by:
gotRegex in interface BSONCallback

gotString

public void gotString(String name,
                      String v)
Specified by:
gotString in interface BSONCallback

gotSymbol

public void gotSymbol(String name,
                      String v)
Specified by:
gotSymbol in interface BSONCallback

gotTimestamp

public void gotTimestamp(String name,
                         int time,
                         int inc)
Specified by:
gotTimestamp in interface BSONCallback

gotObjectId

public void gotObjectId(String name,
                        ObjectId id)
Specified by:
gotObjectId in interface BSONCallback

gotDBRef

public void gotDBRef(String name,
                     String ns,
                     ObjectId id)
Specified by:
gotDBRef in interface BSONCallback

gotBinaryArray

@Deprecated
public void gotBinaryArray(String name,
                                      byte[] data)
Deprecated. 

Specified by:
gotBinaryArray in interface BSONCallback

gotBinary

public void gotBinary(String name,
                      byte type,
                      byte[] data)
Specified by:
gotBinary in interface BSONCallback

gotUUID

public void gotUUID(String name,
                    long part1,
                    long part2)
Description copied from interface: BSONCallback
subtype 3

Specified by:
gotUUID in interface BSONCallback

gotCode

public void gotCode(String name,
                    String code)
Specified by:
gotCode in interface BSONCallback

gotCodeWScope

public void gotCodeWScope(String name,
                          String code,
                          Object scope)
Specified by:
gotCodeWScope in interface BSONCallback

_put

protected void _put(String name,
                    Object o)

cur

protected BSONObject cur()

curName

protected String curName()

get

public Object get()
Specified by:
get in interface BSONCallback

setRoot

protected void setRoot(Object o)

isStackEmpty

protected boolean isStackEmpty()

reset

public void reset()
Specified by:
reset in interface BSONCallback