db4o 7.4

com.db4o.marshall
Interface WriteContext

All Superinterfaces:
Context, WriteBuffer

public interface WriteContext
extends Context, WriteBuffer

this interface is passed to internal class com.db4o.internal.TypeHandler4 during marshalling and provides methods to marshal objects.


Method Summary
 ReservedBuffer reserve(int length)
          reserves a buffer with a specific length at the current position, to be written in a later step.
 void writeObject(java.lang.Object obj)
          makes sure the object is stored and writes the ID of the object to the context.
 void writeObject(TypeHandler4 handler, java.lang.Object obj)
          writes sub-objects, in cases where the TypeHandler4 is known.
 
Methods inherited from interface com.db4o.marshall.Context
objectContainer, transaction
 
Methods inherited from interface com.db4o.marshall.WriteBuffer
writeByte, writeBytes, writeInt, writeLong
 

Method Detail

writeObject

void writeObject(java.lang.Object obj)
makes sure the object is stored and writes the ID of the object to the context. Use this method for first class objects only (objects that have an identity in the database). If the object can potentially be a primitive type, do not use this method but use a matching WriteBuffer method instead.

Parameters:
obj - the object to write.

writeObject

void writeObject(TypeHandler4 handler,
                 java.lang.Object obj)
writes sub-objects, in cases where the TypeHandler4 is known.

Parameters:
obj - the object to write

reserve

ReservedBuffer reserve(int length)
reserves a buffer with a specific length at the current position, to be written in a later step.

Parameters:
length - the length to be reserved.
Returns:
the ReservedBuffer

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.